Class RightAws::S3Generator
In: lib/s3/right_s3.rb
Parent: Object
RuntimeError AwsError AwsNoChange RightAWSParser RightErrorResponseParser RightHttp2xxParser AcfInterface SqsInterface SqsGen2Interface S3Interface Ec2 SdbInterface RightAwsBase ActiveSdbConnect ActiveSdb SqsGen2 S3 S3Generator Sqs RightDummyParser AWSErrorHandler AwsBenchmarkingBlock AwsUtils RightSaxParserCallback lib/sqs/right_sqs_interface.rb lib/sqs/right_sqs_gen2.rb lib/s3/right_s3.rb lib/acf/right_acf_interface.rb lib/sqs/right_sqs_gen2_interface.rb lib/sqs/right_sqs.rb lib/sdb/right_sdb_interface.rb lib/sdb/active_sdb.rb lib/ec2/right_ec2.rb lib/s3/right_s3_interface.rb lib/awsbase/right_awsbase.rb RightAwsBaseInterface VERSION RightAws dot/m_13_0.png

RightAws::S3Generator and RightAws::S3Generator::Bucket methods:

 s3g = RightAws::S3Generator.new('1...2', 'nx...Y6') #=> #<RightAws::S3Generator:0xb7b5cc94>

   # List all buckets(method 'GET'):
 buckets_list = s3g.buckets #=> 'https://s3.amazonaws.com:443/?Signature=Y...D&Expires=1180941864&AWSAccessKeyId=1...2'
   # Create bucket link (method 'PUT'):
 bucket = s3g.bucket('my_awesome_bucket')     #=> #<RightAws::S3Generator::Bucket:0xb7bcbda8>
 link_to_create = bucket.create_link(1.hour)  #=> https://s3.amazonaws.com:443/my_awesome_bucket?Signature=4...D&Expires=1180942132&AWSAccessKeyId=1...2
   # ... or:
 bucket = RightAws::S3Generator::Bucket.create(s3g, 'my_awesome_bucket') #=> #<RightAws::S3Generator::Bucket:0xb7bcbda8>
 link_to_create = bucket.create_link(1.hour)                                 #=> https://s3.amazonaws.com:443/my_awesome_bucket?Signature=4...D&Expires=1180942132&AWSAccessKeyId=1...2
   # ... or:
 bucket = RightAws::S3Generator::Bucket.new(s3g, 'my_awesome_bucket') #=> #<RightAws::S3Generator::Bucket:0xb7bcbda8>
 link_to_create = bucket.create_link(1.hour)                              #=> https://s3.amazonaws.com:443/my_awesome_bucket?Signature=4...D&Expires=1180942132&AWSAccessKeyId=1...2
   # List bucket(method 'GET'):
 bucket.keys(1.day) #=> https://s3.amazonaws.com:443/my_awesome_bucket?Signature=i...D&Expires=1180942620&AWSAccessKeyId=1...2
   # Create/put key (method 'PUT'):
 bucket.put('my_cool_key') #=> https://s3.amazonaws.com:443/my_awesome_bucket/my_cool_key?Signature=q...D&Expires=1180943094&AWSAccessKeyId=1...2
   # Get key data (method 'GET'):
 bucket.get('logs/today/1.log', 1.hour) #=> https://s3.amazonaws.com:443/my_awesome_bucket/my_cool_key?Signature=h...M%3D&Expires=1180820032&AWSAccessKeyId=1...2
   # Delete bucket (method 'DELETE'):
 bucket.delete(2.hour) #=> https://s3.amazonaws.com:443/my_awesome_bucket/logs%2Ftoday%2F1.log?Signature=4...D&Expires=1180820032&AWSAccessKeyId=1...2

RightAws::S3Generator::Key methods:

   # Create Key instance:
 key = RightAws::S3Generator::Key.new(bicket, 'my_cool_key') #=> #<RightAws::S3Generator::Key:0xb7b7394c>
   # Put key data (method 'PUT'):
 key.put    #=> https://s3.amazonaws.com:443/my_awesome_bucket/my_cool_key?Signature=2...D&Expires=1180943302&AWSAccessKeyId=1...2
   # Get key data (method 'GET'):
 key.get    #=> https://s3.amazonaws.com:443/my_awesome_bucket/my_cool_key?Signature=a...D&Expires=1180820032&AWSAccessKeyId=1...2
   # Head key (method 'HEAD'):
 key.head   #=> https://s3.amazonaws.com:443/my_awesome_bucket/my_cool_key?Signature=b...D&Expires=1180820032&AWSAccessKeyId=1...2
   # Delete key (method 'DELETE'):
 key.delete #=> https://s3.amazonaws.com:443/my_awesome_bucket/my_cool_key?Signature=x...D&Expires=1180820032&AWSAccessKeyId=1...2

Methods

bucket   buckets   new  

Classes and Modules

Class RightAws::S3Generator::Bucket
Class RightAws::S3Generator::Key

Attributes

interface  [R] 

Public Class methods

[Source]

     # File lib/s3/right_s3.rb, line 931
931:     def initialize(aws_access_key_id, aws_secret_access_key, params={})
932:       @interface = S3Interface.new(aws_access_key_id, aws_secret_access_key, params)
933:     end

Public Instance methods

Create new S3LinkBucket instance and generate link to create it at S3.

 bucket= s3.bucket('my_owesome_bucket')

[Source]

     # File lib/s3/right_s3.rb, line 947
947:     def bucket(name, expires=nil, headers={})
948:       Bucket.create(self, name.to_s)
949:     end

Generate link to list all buckets

 s3.buckets(1.hour)

[Source]

     # File lib/s3/right_s3.rb, line 939
939:     def buckets(expires=nil, headers={})
940:       @interface.list_all_my_buckets_link(expires, headers)
941:     end

[Validate]