STORAGE S API Storage S API Programmer s Guide Revision 1.0 (20/04/2012) Lunacloud Tel: 0845 070827 21 Southampton Row Email: info@lunacloud.com WC1B 5HA London www.lunacloud.com
Table of Contents CHAPTER 1 LUNACLOUD STORAGE COMPLIANCE WITH THE AMAZON S REST API COMMON REQUEST HEADERS COMMON RESPONSE HEADERS OPERATIONS ON THE SERVICE OPERATIONS ON BUCKETS OPERATIONS ON OBJECTS ACL SUPPORT ERROR RESPONSES CHAPTER 2 DEVELOPING LUNACLOUD STORAGE CLIENT APPLICATIONS: GENERAL GUIDELINES JUST LIKE DEVELOPING FOR AMAZON S WHAT S DISTINCT ABOUT LUNACLOUD STORAGE DEVELOPMENT 5 6 6 8 8 8 8 www.lunacloud.com 2 of 8
Chapter 1 Lunacloud storage compliance with the Amazon S REST API Lunacloud storage supports a large portion of the Amazon S REST API, and complies strictly with that portion. Lunacloud storage does not support the Amazon S SOAP API. For general information about the Amazon S API, see the Amazon Simple Storage Service API Reference (version 2006-0-01). The sections below describe the specifics of Lunacloud storage's compliance with the S REST API. The organization parallels that of the Amazon S API Reference. Where appropriate, links are provided to specific parts of Amazon s API Reference. Common request headers From the list of Amazon S REST API Common Request Headers, Lunacloud storage supports all headers except x-amz-security-token. Common response headers From the list of Amazon S REST API Common Response Headers, Lunacloud storage supports all headers except for: x-amz-id-2 x-amz-request-id Operations on the service Supported Operations Lunacloud storage supports and is fully compliant with the following service operation from the Amazon S REST API: GET Service This is the only service-level operation in the S API. Operations on buckets Supported Operations www.lunacloud.com of 8
Lunacloud storage supports and is fully compliant with the following bucket operations from the Amazon S REST API: DELETE Bucket GET Bucket (List Objects) GET Bucket ACL GET Bucket Location GET Bucket logging GET Bucket Object versions GET Bucket versioning PUT Bucket PUT Bucket ACL PUT Bucket logging PUT Bucket versioning Note: Lunacloud storage supports LocationConstraint. Not Supported Lunacloud storage does not currently support these Amazon S bucket operations: DELETE Bucket lifecycle DELETE Bucket website GET Bucket lifecycle GET Bucket logging GET Bucket notification GET Bucket requestpayment GET Bucket website List Multipart Uploads PUT Bucket lifecycle PUT Bucket logging PUT Bucket notification PUT Bucket requestpayment PUT Bucket website Partial Support for Bucket Policy For Bucket Policy (PUT, GET, DELETE) only the below functions and defined formats are supported. Cloud Storage behaviour for other formats of ACP is undefined. Referer condition for GetObject The only accepted format is the below that allows GetObject on the bucket from only the specified referrer URIs. "Effect":"Allow" www.lunacloud.com 4 of 8
"Principal": { "AWS":"*" } "Action":"s:GetObject" "Resource": "arn:aws:s:::your-bucket-name" o YOUR-BUCKET-NAME is the bucketname. "Condition":{"StringLike":{"aws:Referer":["URI-1"]}, "StringLike":{"aws:Referer":["URI-2"]} } o Multiple StringLike? conditions can be specified. o URI value (e.g., URI-1 and URI-2) is compared to HTTP Referer header with caseinsensitive matching and multi-character wildcard (*) and single-character wildcard (?). Operations on objects Supported Operations Lunacloud storage supports and is fully compliant with the following object operations from the Amazon S REST API: DELETE Object o x-amz-mfa is not currently supported. GET Object o response-* headers are not currently supported. o HTTP headers supported: Range, If-Modified-Since, If-Unmodified-Since, If-Match, If- None-Match GET Object ACL HEAD Object PUT Object o x-amz-storage-class is always STANDARD. Note: Object whose names consist solely of ".." or "/" will be rejected with an error response. PUT Object ACL PUT Object Copy Initiate Multipart Upload Note: Amazon recommends using multipart upload for objects 100MB or larger, and that is a good guideline for Lunacloud as well. For S developer guidance on multipart upload, see Uploading Objects Using Multipart Upload API from the AWS documentation. Upload Part Complete Multipart Upload Abort Multipart Upload List Parts Not Supported Lunacloud storage currently does not support these Amazon S object operations: www.lunacloud.com 5 of 8
GET Object torrent POST Object Upload Part - Copy ACL support Regarding Amazon S ACL functionality: For grantee user groups, the following are supported: o Authenticated users group o All users group Lunacloud storage does not support Log delivery group. For Canned ACL, the following are supported: o private o public-read o public-read-write o authenticated-read Lunacloud storage ignores other canned ACLs. Error responses From the set of Amazon S Error Responses, Lunacloud storage uses the subset of errors listed below. Lunacloud storage s usages of these errors, and its mapping of errors to HTTP status codes, complies with the Amazon specification. AccessDenied AccountProblem BadDigest BucketAlreadyExists BucketNotEmpty EntityTooLarge IllegalVersioningConfigurationException InternalError InvalidAccessKeyId InvalidArgument InvalidBucketName InvalidLocationConstraint InvalidPart InvalidRange InvalidURI KeyTooLong MalformedXML www.lunacloud.com 6 of 8
MissingContentLength NoSuchBucket NoSuchKey NoSuchUpload NotImplemented PreconditionFailed SlowDown TooManyBuckets www.lunacloud.com 7 of 8
Chapter 2 Developing Lunacloud storage client applications: General Guidelines Just like developing for Amazon S In nearly every way, developing a client application for Lunacloud storage is the same as developing a client application for Amazon S. Consequently, when designing and building Lunacloud storage applications you can leverage the wealth of resources available to Amazon S developers. The best place to turn for resources for developing Amazon S and Lunacloud storage applications is the Amazon Web Services (AWS) S web site. On that site, Developer Centers are available for a variety of development technologies: AWS Java Developer Center AWS Windows/.NET Developer Center AWS PHP Developer Center AWS Python Developer Center AWS Ruby Developer Center AWS Developer Centers include SDKs, community libraries, "Getting Started" guides, and tips and tricks. Another good AWS resource is the archive of Articles & Tutorials. The archive includes general articles such as "Best Practices for Using Amazon S" as well as articles and tutorials relating to specific development technologies. Yet another helpful AWS resource is the archive of Sample Code & Libraries. What s distinct about Lunacloud storage development In practice, the main differences between developing for Amazon S and developing for Lunacloud storage are: Lunacloud storage supports most of but not the entire Amazon S API. See Chapter 1 for details. Lunacloud storage client applications must use the Lunacloud storage service endpoint (lcs.lunacloud.com) rather than the Amazon S service endpoint. Lunacloud storage client applications must use HTTP, while Amazon S client libraries default to using HTTPS. www.lunacloud.com 8 of 8