Apache License 2.0
- Ubuntu 12.04 tested, gcc 4.6
- Windows 7+, Visual Studio 2013 update4+
- Mac OSX 10.10, Clang 3.7 tested.
- Windows
- open all.sln in visual studio and build.
- Linux(ubuntu 12.04)
- 1, install cmake, run sudo apt-get install cmake
- 2, install dependencies, run sudo apt-get install libapr1-dev libaprutil1-dev libtinyxml-dev libcurl4-openssl-dev
- 3, run cmake .&& make
- Mac OSX
- 1, install cmake, run sudo brew install cmake
- 2, install dependencies, run brew install tinyxml apr apr-util curl
- 3, then run cmake .&& make
- Bucket
- ListBuckets
- CreateBucket
- DeleteBucket
- BucketExists
- SetBucketAcl
- GetBucketAcl
- GetBucketLocation
- GetBucketLogging
- SetBucketLogging
- DeleteBucketLogging
- GetBucketWebsite
- SetBucketWebsite
- DeleteBucketWebsite
- GetBucketReferer
- SetBucketReferer
- GetBucketLifecycle
- SetBucketLifecycle
- DeleteBucketLifecycle
- GetBucketCors
- SetBucketCors
- DeleteBucketCors
- Object
Status ListBuckets(const ListBucketsRequest& request, ListBucketsResult* result);
Status ListBuckets(std::vector<Bucket>* buckets);
- prefix — return buckets must begin with prefix
- marker — return buckets must start from marker.
- max-key — return buckets must no more than max-keys.
Status CreateBucket(const std::string& bucket_name, const std::string& acl = kAclPrivate);
- bucket_name — the bucket name you wanna use
- acl — initial acl, default to "private"
Status DeleteBucket(const std::string& bucket_name);
- bucket_name — bucket name
Status BucketExists(const std::string& bucket_name, bool* exist);
- bucket_name — bucket name
Status SetBucketAcl(const std::string& bucket_name,
const std::string& acl = kAclPrivate);
- bucket_name — bucket name
- acl — access permission you want to set.
Status GetBucketAcl(const std::string& bucket_name, std::string* acl);
- bucket_name — bucket name
Status GetBucketLocation(const std::string& bucket_name, std::string* location);
- bucket_name — bucket name
Status GetBucketLogging(const std::string& bucket_name, GetBucketLoggingResult* result);
- bucket_name — bucket name
Status SetBucketLogging(const SetBucketLoggingRequest& request);
- target_bucket — the bucket actually store logs.
- target_prefix — the prefix of log file name.
- source_bucket — the bucket you want to enable logging on.
Status DeleteBucketLogging(const std::string& bucket_name);
- bucket_name — bucket name
Status GetBucketWebsite(const std::string& bucket_name, GetBucketWebsiteResult* result);
- bucket_name — bucket name
Status SetBucketWebsite(const std::string& bucket_name,
const std::string& index_page,
const std::string& error_page);
- bucket_name — bucket name
- index_page — bucket's index page.
- error_page — bucket's "not found" page
Status DeleteBucketWebsite(const std::string& bucket_name);
- bucket_name — bucket name
Status GetBucketReferer(const std::string& bucket_name,
GetBucketRefererResult* result);
- bucket_name — bucket name
Status SetBucketReferer(const SetBucketRefererRequest& request);
- bucket_name — bucket name
- referer_list — allow website list.
- allow_empty — allow empty refere or not.
Status GetBucketLifecycle(const std::string& bucket_name,
GetBucketLifecycleResult* result);
- bucket_name — bucket name
Status GetBucketLifecycle(const std::string& bucket_name,
GetBucketLifecycleResult* result);
- bucket_name — bucket name
- rule_list — lifecycle rule list
Status DeleteBucketLifecycle(const std::string& bucket_name);
- bucket_name — bucket name
Status GetBucketCors(const std::string& bucket_name,
GetBucketCorsResult* result);
- bucket_name — bucket name
Status SetBucketCors(const SetBucketCorsRequest& request);
- bucket_name — bucket name
- rule_list — cors rule list
Status DeleteBucketCors(const std::string& bucket_name);
- bucket_name — bucket name
Status ListObjects(const ListObjectsRequest& request, ListObjectsResult* result);
- bucket_name — bucket name
- delimiter — delimiter used to group objects
- prefix — return objects must begin with prefix
- marker — return objects must start from marker.
- max-key — return objects must no more than max-keys.
Status CreateFolder(const std::string& bucket_name, const std::string& folder_name);
- bucket_name — bucket name
- folder_name — folder name, no matter with or without slash(/)
Status ObjectExists(const std::string& bucket_name, const std::string& key, bool* exist);
- bucket_name — bucket name
- key — object key
Status PutString(const std::string & bucket_name,
const std::string & key,
const std::string & str,
const ObjectMetadata* object_metadata = NULL);
- bucket_name — bucket name
- key — object key
- str — arbitrary data used to write to the object
- object_metadata — specify your own object metadata
Status PutObject(const std::string & bucket_name,
const std::string & key,
const std::string & file_path,
const ObjectMetadata* object_metadata = NULL);
Status PutObject(const std::string& bucket_name,
const std::string& key,
const std::string& file_path,
int64_t stream_bytes,
const ObjectMetadata* object_metadata = NULL);
Status PutObject(const std::string& bucket_name,
const std::string& key,
std::ifstream* stream,
const ObjectMetadata* object_metadata = NULL);
Status PutObject(const std::string& bucket_name,
const std::string& key,
std::ifstream* stream,
int64_t stream_bytes,
const ObjectMetadata* object_metadata = NULL);
- bucket_name — bucket name
- key — object key
- file_path — local file to upload
- stream — local stream to upload
- stream_bytes — upload bytes must no more than stream_bytes.
- object_metadata — specify your own object metadata.
Status DeleteObject(const std::string & bucket_name, const std::string & key);
- bucket_name — bucket name
Status DeleteMultipleObjects(const DeleteMultipleObjectsRequest& request,
DeleteMultipleObjectsResult* result);
- bucket_name — bucket name
- key — object key
- quiet — if true, result contains all the key in your request otherwise, result only contains "failed deletion" keys.
Status OptionObject(const OptionObjectRequest& request, OptionObjectResult* result);
- bucket_name — bucket name
- key — object key
- origin — origin used to test
- request_method — http method used to test
- request_headers — http header used to test.
Status CopyObject(const CopyObjectRequest& request, CopyObjectResult* result);
- source_bucket — source bucket
- source_key — source key
- target_bucket — target bucket
- target_key — target key
- ...
- ...
Status GetObject(const GetObjectRequest& request);
- bucket_name — bucket name
- key — object key
- file_path — download to this path
- output_stream — download to this stream
Status GetObjectMetadata(const std::string& bucket_name,
const std::string& key,
std::unique_ptr<ObjectMetadata>* object_meta_data);
- bucket_name — bucket name
- key — object key
Status AppendObject(const AppendObjectRequest& request);
Status AppendObject(const AppendObjectRequest& request,
const ObjectMetadata* object_metadata);
Status AppendObject(const AppendObjectRequest& request,
const ObjectMetadata* object_metadata,
AppendObjectResult* result);
- bucket_name — bucket name
- key — object key
- file_path — local file for upload
- position — position of file for read from.
Status InitiateMultipartUpload(const InitiateMultipartUploadRequest& request,
InitiateMultipartUploadResult* result);
- bucket_name — bucket name
- key — object key
Status UploadPart(const UploadPartRequest& request, UploadPartResult* result);
- bucket_name — bucket name
- key — object key
- upload_id — unique id for upload
- input_steam — stream for read
- part_number — part unique number.
- part_size — bytes to read
- md5_digest — md5 checksum for chcksum.
Status UploadPartCopy(const UploadPartCopyRequest& request,
UploadPartCopyResult* result);
- source_bucket — souree bucket name
- source_key — souree object key
- target_bucket — target bucket name
- target_key — target object key
- upload_id — unique id for upload
- part_number — part unique number.
- part_size — bytes to read
Status CompleteMultipartUpload(const CompleteMultipartUploadrequest& request,
CompleteMultipartUploadResult* result);
- bucket_name — bucket name
- key — object key
- upload_id — unique id for upload
- etag_list — etag list of previous uploads.
Status AbortMultipartUpload(const std::string& bucket_name,
const std::string& key,
const std::string& upload_id);
- bucket_name — bucket name
- key — object key
- upload_id — unique id for upload
Status ListMultipartUploads(const ListMultipartUploadsRequest& request,
ListMultipartUploadsResult* result);
- bucket_name — bucket name
- delimiter — delimiter used to group uploads
- max-key — return uploads must no more than max-keys.
- key_marker — keys must start from key_marker.
- prefix — return objects must begin with prefix
- upload_id_marker — upload id must start from upload_id_marker.
Status ListParts(const ListPartsRequest& request, ListPartsResult* result);
- bucket_name — bucket name
- key — object key
- upload_id_ — unique id for upload
- max-parts — return parts must no more than max-parts
- part_number_marker — part number must start from part_number_marker