1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|storage] doc work, adding links to api docs

This commit is contained in:
geemus 2010-10-29 18:05:59 -07:00
parent 06a0bd082e
commit a8bdd19c62
24 changed files with 82 additions and 3 deletions

View file

@ -25,6 +25,9 @@ module Fog
# * 'ETag'<~String> - etag of new object
# * 'LastModified'<~Time> - date object was last modified
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectCOPY.html
def copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {})
headers = { 'x-amz-copy-source' => "/#{source_bucket_name}/#{source_object_name}" }.merge!(options)
request({

View file

@ -11,6 +11,10 @@ module Fog
# ==== Returns
# * response<~Excon::Response>:
# * status<~Integer> - 204
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETE.html
def delete_bucket(bucket_name)
request({
:expects => 204,

View file

@ -12,6 +12,10 @@ module Fog
# ==== Returns
# * response<~Excon::Response>:
# * status<~Integer> - 204
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectDELETE.html
def delete_object(bucket_name, object_name)
request({
:expects => 204,

View file

@ -36,6 +36,9 @@ module Fog
# * 'Size'<~Integer> - Size of object
# * 'StorageClass'<~String> - Storage class of object
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGET.html
def get_bucket(bucket_name, options = {})
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -26,6 +26,9 @@ module Fog
# * 'URI'<~String> - URI of group to grant access for
# * 'Permission'<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETacl.html
def get_bucket_acl(bucket_name)
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -14,6 +14,10 @@ module Fog
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'LocationConstraint'<~String> - Location constraint of the bucket
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETlocation.html
def get_bucket_location(bucket_name)
request({
:expects => 200,

View file

@ -26,6 +26,9 @@ module Fog
# * 'URI'<~String> - URI of group to grant access for
# * 'Permission'<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETlogging.html
def get_bucket_logging(bucket_name)
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -51,6 +51,9 @@ module Fog
# * 'StorageClass'<~String> - Storage class of object
# * 'VersionId'<~String> - The id of this version
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETVersion.html
def get_bucket_object_versions(bucket_name, options = {})
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -16,6 +16,9 @@ module Fog
# * 'VersioningConfiguration'<~Hash>
# * Status<~String>: Versioning status in ['Enabled', 'Suspended', nil]
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETversioningStatus.html
def get_bucket_versioning(bucket_name)
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -25,6 +25,9 @@ module Fog
# * 'ETag'<~String> - Etag of object
# * 'Last-Modified'<~String> - Last modified timestamp for object
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGET.html
def get_object(bucket_name, object_name, options = {}, &block)
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -29,6 +29,9 @@ module Fog
# * 'URI'<~String> - URI of group to grant access for
# * 'Permission'<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGETacl.html
def get_object_acl(bucket_name, object_name, options = {})
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -23,6 +23,9 @@ module Fog
# * 'ID'<~String> - Id of grantee
# * 'Permission'<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGETtorrent.html
def get_object_torrent(bucket_name, object_name)
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -14,6 +14,9 @@ module Fog
# * response<~Excon::Response>:
# * body<~String> - url for object
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html
def get_object_url(bucket_name, object_name, expires)
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -14,6 +14,10 @@ module Fog
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'Payer'<~String> - Specifies who pays for download and requests
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTrequestPaymentGET.html
def get_request_payment(bucket_name)
request({
:expects => 200,

View file

@ -16,6 +16,10 @@ module Fog
# * 'Owner'<~Hash>:
# * 'DisplayName'<~String> - Display name of bucket owner
# * 'ID'<~String> - Id of bucket owner
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html
def get_service
request({
:expects => 200,

View file

@ -24,6 +24,10 @@ module Fog
# * 'Content-Type'<~String> - MIME type of object
# * 'ETag'<~String> - Etag of object
# * 'Last-Modified'<~String> - Last modified timestamp for object
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectHEAD.html
def head_object(bucket_name, object_name, options={})
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -22,8 +22,9 @@ module Fog
# * x-amz-security-token - devpay security token
# * x-amz-meta-... - meta data tags
#
# See also: http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html
def post_object_hidden_fields(options = {})
if options['policy']
options['policy'] = options['policy'].to_json

View file

@ -15,8 +15,9 @@ module Fog
# * response<~Excon::Response>:
# * status<~Integer> - 200
#
# ==== API Reference
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html
def put_bucket(bucket_name, options = {})
if location_constraint = options.delete('LocationConstraint')
data =

View file

@ -20,6 +20,10 @@ module Fog
# or
# * 'URI'<~String> - URI of group to grant access for
# * Permission<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTacl.html
def put_bucket_acl(bucket_name, acl)
data =
<<-DATA

View file

@ -20,6 +20,10 @@ module Fog
# or
# * 'URI'<~String> - URI of group to grant access for
# * Permission<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTlogging.html
def put_bucket_logging(bucket_name, logging_status)
if logging_status['LoggingEnabled'].empty?
data =

View file

@ -8,6 +8,10 @@ module Fog
# ==== Parameters
# * bucket_name<~String> - name of bucket to modify
# * status<~String> - Status to change to in ['Enabled', 'Suspended']
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html
def put_bucket_versioning(bucket_name, status)
data =
<<-DATA

View file

@ -23,6 +23,10 @@ module Fog
# * response<~Excon::Response>:
# * headers<~Hash>:
# * 'ETag'<~String> - etag of new object
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectPUT.html
def put_object(bucket_name, object_name, data, options = {})
data = parse_data(data)
headers = data[:headers].merge!(options)

View file

@ -14,6 +14,9 @@ module Fog
# * response<~Excon::Response>:
# * body<~String> - url for object
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html
def put_object_url(bucket_name, object_name, expires)
unless bucket_name
raise ArgumentError.new('bucket_name is required')

View file

@ -8,6 +8,10 @@ module Fog
# ==== Parameters
# * bucket_name<~String> - name of bucket to modify
# * payer<~String> - valid values are BucketOwner or Requester
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTrequestPaymentPUT.html
def put_request_payment(bucket_name, payer)
data =
<<-DATA