s3-api閱讀筆記(待整理)

oxoxooxx發表於2011-05-15

xcat 配置管理工具使用perl寫的
curl http請求傳送接受工具,s3curl.pl是用perl封裝的指令碼命令
--需要熟悉perl指令碼命令
s3實現用了java了寫
cassendra資料庫也是用java寫的
--需要熟悉java的API

s3-api閱讀筆記
DELETE /myobject HTTP/1.1
Date:26 NOV 2011 10:24:32
Host:mybucket.s3.amazon.com
s3_aws_acl:
content_type:
Authorization:

Each request that uses Amazon DevPay require two x-amz-security-token heads:
one for the product token
one for the user token

All objects including all object versions and Delete Markers in the bucket
must be deleted before the bucket itself can be deleted.

//delete bucket
DELETE / HTTP/1.1
Host: BucketName.s3.amazon.com
Date: date
Authorization: signatureValue

//delete the website configuration on the specified bucket
DELETE ?website HTTP/1.1
Host: example-bucket.s3.amazonaws.com
Date: Thu, 27 Jan 2011 12:00:00 GMT
Authorization: AWS signature
?測試?website --&gt /?website

list bucket's objects ,the response attributes:
StorageClass -Always STANDARD


GET ?delimiter=/ HTTP/1.1

//Get bucket policy
GET ?policy HTTP/1.1
Host: bucket.s3.amazonaws.com
Date: Wed,28 Oct 2009 22:32:00 GMT
Authorization:AWS ...

Response:
...
{
"Version":"2008-10-17",
"Id":"aaaa-bbbb-cccc-dddd",
"Statement":[
{
"Effect":"Deny",
"Sid":"1",
"Principal":{
"AWS":["1-22-333-4444","3-55-678-9100"]
},
"Action":["s3:*"],
"Response":"arn:aws:s3:::bucket/*",
}
}
}
...

//GET Bucket notification
Currently,the s3:ReducedRedundancyLostObject event is the only event supported for
notifications.

The s3:ReduceRedundancyLostObject event is triggered when Amazon S3 detects that it has
lost all replicas of a Reduced Redundancy Storage object and can no longer service
requests for that object.


//GET Bucket versioning
MFA Delete status


//PUT Bucket policy
PUT /?policy HTTP/1.1
Host: BucketName.s3.amazonaws.com
Date: date
Authorization: signatureValue
-Policy written in JSON

Note that Amazon S3 doesn't send a test notification when
notification are turned off.


//PUT Bucket versioning
x-amz-mfa The value is the concatenatioin of the authentication device's serial
number,a space,and the value displayed on your authentication device.

The POST operation adds an object to a specified bucket using HTML forms.

Amazon S3 never stores partial objects:if you receive a successful response,
you can be confident the entire object was stored.

100-continue HTTP status code

//PUT Object(Copy)
You can store individual objects of up to 5TB in S3.However,you can copy only
objects that are less than 5GB in size.

All copy requests must be authenticated and cannot contain a message body.
Additionally,you must have READ access to the source object and write access to the
destination bucket.

Note
All headers prefixed with x-amz- must be signed,including x-amz-copy-source.

有兩種情況會發生複製物件錯誤,一種是傳送複製請求時,另一種是S3正在複製物件。
前一種會接受到標準的S3錯誤,後一種出錯響應是嵌在200響應中的,因此200響應也可能
包含錯誤,所以要注意解析響應的內容並正確的處理。

?By default,x-amz-copy-source identifies the latest version of an object to
copy.If latest version is a Delete Marker,Amazon S3 behaves as if the object
was deleted.?

If you do not enable Versioning or suspend it on the target bucket,the verion
ID Amazon S3 generates is always null.

sg中描述在S3中透過bucket+object+version 唯一確定一個物件,在copy操作是如果目標bucket
啟用了versioning,則每次複製一個object進來都由S3生成一個不同於原version id和目標
bucket中同名object的version id 的id。??問題是如果目標bucket沒有啟用versioning
那麼是禁止複製同名obejct呢還是?

x-amz-acl valid values:
private
public-read
public-read-write
authenticated-read
bucket-owner-read
bucket-owner-full-control

x-amz-metadata-directive :
Specified whether the metadata is copied from the source object or replaced
with metadata provided in the request.If copied,the metadata,except for version
ID,remains unchanged.Otherwise all original metadata is replaced by the metadata
you specify.

You cann't copy an object to itself unless the MetadataDirective header is
specified and its value set to REPLACE.

x-amz-storage-class:
RRS enables customers to reduce their costs by storing non-critical,reproducible
data at lower levels of redundancy than Amazon S3's standard storage.
Valid Values:STANDARD||REDUCED_REDUNDANCY

Cache-Control:
Can be used to specify caching behavior along the request/reply chain.

presentational 表象,直覺

//Upload Part
Expect:
When your application uses 100-continue,it does not send the request body
until it receives an acknowledgement.If the message is rejected based on the
header,the body of the message is not sent.
Valid Values:100-continue

IAM user
IAM(Identity and Access Management 的縮寫),
即“身份識別與訪問管理”,具有單點登入、強大的認證管理、
基於策略的集中式授權和審計、動態授權、企業可管理性等功能;


[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23937368/viewspace-1049893/,如需轉載,請註明出處,否則將追究法律責任。

相關文章