Module: Aliyun::OSS

Defined in:
lib/aliyun/oss/base.rb,
lib/aliyun/oss/acl.rb,
lib/aliyun/oss/error.rb,
lib/aliyun/oss/owner.rb,
lib/aliyun/oss/bucket.rb,
lib/aliyun/oss/object.rb,
lib/aliyun/oss/logging.rb,
lib/aliyun/oss/parsing.rb,
lib/aliyun/oss/service.rb,
lib/aliyun/oss/version.rb,
lib/aliyun/oss/response.rb,
lib/aliyun/oss/connection.rb,
lib/aliyun/oss/exceptions.rb,
lib/aliyun/oss/authentication.rb

Overview

Aliyun::OSS is a Ruby library for Aliyun’s Open Storage Service’s REST API (aliyun.aliyun.com/oss). Full documentation of the currently supported API can be found at docs.aliyunwebservices.com/AliyunOSS/2006-03-01.

Getting started

To get started you need to require ‘aliyun/oss’:

% irb -rubygems
irb(main):001:0> require 'aliyun/oss'
# => true

The Aliyun::OSS library ships with an interactive shell called osssh. From within it, you have access to all the operations the library exposes from the command line.

% osssh
>> Version

Before you can do anything, you must establish a connection using Base.establish_connection!. A basic connection would look something like this:

Aliyun::OSS::Base.establish_connection!(
  :access_key_id     => 'abc', 
  :secret_access_key => '123'
)

The minimum connection options that you must specify are your access key id and your secret access key.

(If you don’t already have your access keys, all you need to sign up for the OSS service is an account at Aliyun. You can sign up for OSS and get access keys by visiting aliyun.aliyun.com/oss.)

For convenience, if you set two special environment variables with the value of your access keys, the console will automatically create a default connection for you. For example:

% cat .aliyun_keys
export OSS_ACCESS_KEY_ID='abcdefghijklmnop'
export OSS_SECRET_ACCESS_KEY='1234567891012345'

Then load it in your shell’s rc file.

% cat .zshrc
if [[ -f "$HOME/.aliyun_keys" ]]; then
  source "$HOME/.aliyun_keys";
fi

See more connection details at Aliyun::OSS::Connection::Management::ClassMethods.

Defined Under Namespace

Modules: ACL, Logging, Parsing, VERSION Classes: Authentication, Base, Bucket, Connection, CurrentBucketNotSpecified, DeletedObject, Error, ExceptionClassClash, FindResponseClass, InternalError, InvalidAccessControlLevel, InvalidBucketName, InvalidConnectionOption, InvalidKeyName, InvalidMetadataValue, InvalidOption, MissingAccessKey, NoBucketSpecified, NoConnectionEstablished, NoKeySpecified, NoSuchKey, OSSException, OSSObject, Owner, RequestTimeout, ResponseError, Service

Constant Summary collapse

Version =
[VERSION::MAJOR, VERSION::MINOR, VERSION::TINY, VERSION::BETA].compact * '.'