s3-api阅读笔记(待整理)

本文详细介绍了Amazon S3对象存储的各项功能与操作细节,包括使用Perl和Java进行配置管理及数据库交互的方法,同时深入探讨了S3 API的各种请求类型及其响应格式。

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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23937368/viewspace-1049893/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值