This document provides guidance on developing applications using Lunacloud storage, which supports a large portion of the Amazon S3 REST API. It outlines Lunacloud storage's compliance with common request/response headers and bucket/object operations. It also describes error responses and recommends developing Lunacloud storage clients similarly to Amazon S3 clients, using AWS developer resources, but noting the Lunacloud storage service endpoint and lack of full API support.
DSPy a system for AI to Write Prompts and Do Fine Tuning
Programmer's Guide to Lunacloud Storage S3 API Compliance
1. STORAGE S3 API
Lunacloud Tel: 0845 0730827
21 Southampton Row Email: info@lunacloud.com
WC1B 5HA London www.lunacloud.com
Storage
S3 API
Programmer’s Guide
Revision 1.0 (20/04/2012)
2. STORAGE API
www.lunacloud.com 2 of 8
Table of Contents
CHAPTER 1 3
LUNACLOUD STORAGE COMPLIANCE WITH THE AMAZON S3 REST API 3
COMMON REQUEST HEADERS 3
COMMON RESPONSE HEADERS 3
OPERATIONS ON THE SERVICE 3
OPERATIONS ON BUCKETS 3
OPERATIONS ON OBJECTS 5
ACL SUPPORT 6
ERROR RESPONSES 6
CHAPTER 2 8
DEVELOPING LUNACLOUD STORAGE CLIENT APPLICATIONS: GENERAL GUIDELINES 8
JUST LIKE DEVELOPING FOR AMAZON S3 8
WHAT’S DISTINCT ABOUT LUNACLOUD STORAGE DEVELOPMENT 8
3. STORAGE API
www.lunacloud.com 3 of 8
Chapter 1
Lunacloud storage compliance with the Amazon S3 REST API
Lunacloud storage supports a large portion of the Amazon S3 REST API, and complies strictly with that
portion. Lunacloud storage does not support the Amazon S3 SOAP API.
For general information about the Amazon S3 API, see the Amazon Simple Storage Service API
Reference (version 2006-03-01).
The sections below describe the specifics of Lunacloud storage's compliance with the S3 REST API.
The organization parallels that of the Amazon S3 API Reference. Where appropriate, links are
provided to specific parts of Amazon’s API Reference.
Common request headers
From the list of Amazon S3 REST API Common Request Headers, Lunacloud storage supports all
headers except x-amz-security-token.
Common response headers
From the list of Amazon S3 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 S3 REST API:
• GET Service
This is the only service-level operation in the S3 API.
Operations on buckets
Supported Operations
4. STORAGE API
www.lunacloud.com 4 of 8
Lunacloud storage supports and is fully compliant with the following bucket operations from the
Amazon S3 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 S3 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"
5. STORAGE API
www.lunacloud.com 5 of 8
• "Principal": { "AWS":"*" }
• "Action":"s3:GetObject"
• "Resource": "arn:aws:s3:::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 case-
insensitive 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 S3 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 S3 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 S3 object operations:
6. STORAGE API
www.lunacloud.com 6 of 8
• GET Object torrent
• POST Object
• Upload Part - Copy
ACL support
Regarding Amazon S3 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 S3 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
8. STORAGE API
www.lunacloud.com 8 of 8
Chapter 2
Developing Lunacloud storage client applications: General
Guidelines
Just like developing for Amazon S3
In nearly every way, developing a client application for Lunacloud storage is the same as developing a
client application for Amazon S3. Consequently, when designing and building Lunacloud storage
applications you can leverage the wealth of resources available to Amazon S3 developers.
The best place to turn for resources for developing Amazon S3 and Lunacloud storage applications is
the Amazon Web Services (AWS) S3 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 S3" 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 S3 and developing for Lunacloud
storage are:
• Lunacloud storage supports most of but not the entire Amazon S3 API. See Chapter 1 for
details.
• Lunacloud storage client applications must use the Lunacloud storage service endpoint
(lcs.lunacloud.com) rather than the Amazon S3 service endpoint.
• Lunacloud storage client applications must use HTTP, while Amazon S3 client libraries default
to using HTTPS.