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

[storage] refactor provider/service namespacing

This commit is contained in:
geemus 2011-06-15 14:26:43 -07:00
parent a1d2ef0ec7
commit e1512c9ac8
123 changed files with 416 additions and 460 deletions

View file

@ -36,6 +36,9 @@ else
Formatador.display_line(":#{Fog.credential} provides #{providers}")
providers = Fog.providers
# FIXME: hacks until we can `include Fog` in bin
Storage = Fog::Storage
catch(:IRB_EXIT) { @irb.eval_input }
end

View file

@ -20,7 +20,7 @@ class AWS < Fog::Bin
when :ses
Fog::AWS::SES
when :eu_storage, :storage
Fog::AWS::Storage
Fog::Storage::AWS
when :rds
Fog::AWS::RDS
else
@ -55,6 +55,7 @@ class AWS < Fog::Bin
when :ses
Fog::AWS::SES.new
when :storage
Formatador.display_line("[yellow][WARN] AWS[:storage] is deprecated, use Storage[:aws] instead[/]")
Fog::Storage.new(:provider => 'AWS')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"

View file

@ -4,7 +4,7 @@ class Google < Fog::Bin
def class_for(key)
case key
when :storage
Fog::Google::Storage
Fog::Storage::Google
else
raise ArgumentError, "Unsupported #{self} service: #{key}"
end
@ -14,6 +14,7 @@ class Google < Fog::Bin
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :storage
Formatador.display_line("[yellow][WARN] Google[:storage] is deprecated, use Storage[:google] instead[/]")
Fog::Storage.new(:provider => 'Google')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"

View file

@ -4,7 +4,7 @@ class Local < Fog::Bin
def class_for(key)
case key
when :storage
Fog::Local::Storage
Fog::Storage::Local
else
raise ArgumentError, "Unsupported #{self} service: #{key}"
end
@ -14,6 +14,7 @@ class Local < Fog::Bin
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :storage
Formatador.display_line("[yellow][WARN] Local[:storage] is deprecated, use Storage[:local] instead[/]")
Fog::Storage.new(:provider => 'Local')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"

View file

@ -8,7 +8,7 @@ class Rackspace < Fog::Bin
when :compute
Fog::Rackspace::Compute
when :storage
Fog::Rackspace::Storage
Fog::Storage::Rackspace
else
raise ArgumentError, "Unrecognized service: #{key}"
end
@ -24,6 +24,7 @@ class Rackspace < Fog::Bin
when :dns
Fog::DNS.new(:provider => 'Rackspace')
when :storage
Formatador.display_line("[yellow][WARN] Rackspace[:storage] is deprecated, use Storage[:rackspace] instead[/]")
Fog::Storage.new(:provider => 'Rackspace')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"

View file

@ -1,26 +1,41 @@
module Fog
class Storage
module Storage
def self.[](provider)
self.new(:provider => provider)
end
def self.new(attributes)
attributes = attributes.dup # prevent delete from having side effects
case provider = attributes[:provider] # attributes.delete(:provider)
when 'AWS'
case provider = attributes[:provider].to_s.downcase.to_sym # attributes.delete(:provider)
when :aws
require 'fog/storage/aws'
Fog::AWS::Storage.new(attributes)
when 'Google'
Fog::Storage::AWS.new(attributes)
when :google
require 'fog/storage/google'
Fog::Google::Storage.new(attributes)
when 'Local'
Fog::Storage::Google.new(attributes)
when :local
require 'fog/storage/local'
Fog::Local::Storage.new(attributes)
when 'Rackspace'
Fog::Storage::Local.new(attributes)
when :rackspace
require 'fog/storage/rackspace'
Fog::Rackspace::Storage.new(attributes)
Fog::Storage::Rackspace.new(attributes)
else
raise ArgumentError.new("#{provider} is not a recognized storage provider")
end
end
def self.directories
directories = []
for provider in [:aws, :google, :local, :rackspace]
begin
directories.concat(self[provider].directories)
rescue # ignore any missing credentials/etc
end
end
directories
end
def self.get_body_size(body)
if body.respond_to?(:force_encoding)
body.force_encoding('BINARY')

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage < Fog::Service
module Storage
class AWS < Fog::Service
requires :aws_access_key_id, :aws_secret_access_key
recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent
@ -162,13 +162,6 @@ module Fog
end
def initialize(options={})
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::AWS::Storage.new is deprecated, use Fog::Storage.new(:provider => 'AWS') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
require 'mime/types'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@ -225,13 +218,6 @@ module Fog
# ==== Returns
# * S3 object with connection to aws.
def initialize(options={})
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::AWS::Storage.new is deprecated, use Fog::Storage.new(:provider => 'AWS') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
require 'fog/core/parser'
require 'mime/types'

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage < Fog::Service
module Storage
class Google < Fog::Service
requires :google_storage_access_key_id, :google_storage_secret_access_key
recognizes :host, :port, :scheme, :persistent
@ -124,13 +124,6 @@ module Fog
end
def initialize(options={})
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::Google::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Google') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
require 'mime/types'
@google_storage_access_key_id = options[:google_storage_access_key_id]
end
@ -171,13 +164,6 @@ module Fog
# ==== Returns
# * Storage object with connection to google.
def initialize(options={})
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::Google::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Google') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
require 'fog/core/parser'
require 'mime/types'

View file

@ -1,6 +1,6 @@
module Fog
module Local
class Storage < Fog::Service
module Storage
class Local < Fog::Service
requires :local_root
recognizes :provider # remove post deprecation
@ -27,13 +27,6 @@ module Fog
Fog::Mock.not_implemented
require 'mime/types'
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::Local::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Local') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
@local_root = ::File.expand_path(options[:local_root])
end
@ -58,13 +51,6 @@ module Fog
class Real
def initialize(options={})
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::Local::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Local') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
require 'mime/types'
@local_root = ::File.expand_path(options[:local_root])
end

View file

@ -2,12 +2,12 @@ require 'fog/core/collection'
require 'fog/storage/models/aws/directory'
module Fog
module AWS
class Storage
module Storage
class AWS
class Directories < Fog::Collection
model Fog::AWS::Storage::Directory
model Fog::Storage::AWS::Directory
def all
data = connection.get_service.body['Buckets']

View file

@ -2,8 +2,8 @@ require 'fog/core/model'
require 'fog/storage/models/aws/files'
module Fog
module AWS
class Storage
module Storage
class AWS
class Directory < Fog::Model
@ -39,7 +39,7 @@ module Fog
def files
@files ||= begin
Fog::AWS::Storage::Files.new(
Fog::Storage::AWS::Files.new(
:directory => self,
:connection => connection
)

View file

@ -1,8 +1,8 @@
require 'fog/core/model'
module Fog
module AWS
class Storage
module Storage
class AWS
class File < Fog::Model

View file

@ -2,8 +2,8 @@ require 'fog/core/collection'
require 'fog/storage/models/aws/file'
module Fog
module AWS
class Storage
module Storage
class AWS
class Files < Fog::Collection
@ -15,7 +15,7 @@ module Fog
attribute :max_keys, :aliases => ['MaxKeys', 'max-keys']
attribute :prefix, :aliases => 'Prefix'
model Fog::AWS::Storage::File
model Fog::Storage::AWS::File
def all(options = {})
requires :directory
@ -70,7 +70,7 @@ module Fog
when /<Code>NoSuchKey<\/Code>/
nil
when /<Code>NoSuchBucket<\/Code>/
raise(Fog::AWS::Storage::NotFound.new("Directory #{directory.identity} does not exist."))
raise(Fog::Storage::AWS::NotFound.new("Directory #{directory.identity} does not exist."))
else
raise(error)
end

View file

@ -2,12 +2,12 @@ require 'fog/core/collection'
require 'fog/storage/models/google/directory'
module Fog
module Google
class Storage
module Storage
class Google
class Directories < Fog::Collection
model Fog::Google::Storage::Directory
model Fog::Storage::Google::Directory
def all
data = connection.get_service.body['Buckets']

View file

@ -2,8 +2,8 @@ require 'fog/core/model'
require 'fog/storage/models/google/files'
module Fog
module Google
class Storage
module Storage
class Google
class Directory < Fog::Model
@ -29,7 +29,7 @@ module Fog
def files
@files ||= begin
Fog::Google::Storage::Files.new(
Fog::Storage::Google::Files.new(
:directory => self,
:connection => connection
)

View file

@ -1,8 +1,8 @@
require 'fog/core/model'
module Fog
module Google
class Storage
module Storage
class Google
class File < Fog::Model

View file

@ -2,8 +2,8 @@ require 'fog/core/collection'
require 'fog/storage/models/google/file'
module Fog
module Google
class Storage
module Storage
class Google
class Files < Fog::Collection
@ -15,7 +15,7 @@ module Fog
attribute :max_keys, :aliases => ['MaxKeys', 'max-keys']
attribute :prefix, :aliases => 'Prefix'
model Fog::Google::Storage::File
model Fog::Storage::Google::File
def all(options = {})
requires :directory

View file

@ -2,12 +2,12 @@ require 'fog/core/collection'
require 'fog/storage/models/local/directory'
module Fog
module Local
class Storage
module Storage
class Local
class Directories < Fog::Collection
model Fog::Local::Storage::Directory
model Fog::Storage::Local::Directory
def all
data = Dir.entries(connection.local_root).select do |entry|

View file

@ -2,8 +2,8 @@ require 'fog/core/model'
require 'fog/storage/models/local/files'
module Fog
module Local
class Storage
module Storage
class Local
class Directory < Fog::Model
@ -22,7 +22,7 @@ module Fog
def files
@files ||= begin
Fog::Local::Storage::Files.new(
Fog::Storage::Local::Files.new(
:directory => self,
:connection => connection
)

View file

@ -1,8 +1,8 @@
require 'fog/core/model'
module Fog
module Local
class Storage
module Storage
class Local
class File < Fog::Model

View file

@ -2,14 +2,14 @@ require 'fog/core/collection'
require 'fog/storage/models/local/file'
module Fog
module Local
class Storage
module Storage
class Local
class Files < Fog::Collection
attribute :directory
model Fog::Local::Storage::File
model Fog::Storage::Local::File
def all
requires :directory

View file

@ -2,12 +2,12 @@ require 'fog/core/collection'
require 'fog/storage/models/rackspace/directory'
module Fog
module Rackspace
class Storage
module Storage
class Rackspace
class Directories < Fog::Collection
model Fog::Rackspace::Storage::Directory
model Fog::Storage::Rackspace::Directory
def all
data = connection.get_containers.body
@ -28,7 +28,7 @@ module Fog
directory.files << directory.files.new(file)
end
directory
rescue Fog::Rackspace::Storage::NotFound
rescue Fog::Storage::Rackspace::NotFound
nil
end

View file

@ -2,8 +2,8 @@ require 'fog/core/model'
require 'fog/storage/models/rackspace/files'
module Fog
module Rackspace
class Storage
module Storage
class Rackspace
class Directory < Fog::Model
@ -23,7 +23,7 @@ module Fog
def files
@files ||= begin
Fog::Rackspace::Storage::Files.new(
Fog::Storage::Rackspace::Files.new(
:directory => self,
:connection => connection
)

View file

@ -1,8 +1,8 @@
require 'fog/core/model'
module Fog
module Rackspace
class Storage
module Storage
class Rackspace
class File < Fog::Model

View file

@ -2,8 +2,8 @@ require 'fog/core/collection'
require 'fog/storage/models/rackspace/file'
module Fog
module Rackspace
class Storage
module Storage
class Rackspace
class Files < Fog::Collection
@ -13,7 +13,7 @@ module Fog
attribute :path
attribute :prefix
model Fog::Rackspace::Storage::File
model Fog::Storage::Rackspace::File
def all(options = {})
requires :directory
@ -60,7 +60,7 @@ module Fog
:key => key
})
new(file_data)
rescue Fog::Rackspace::Storage::NotFound
rescue Fog::Storage::Rackspace::NotFound
nil
end
@ -78,7 +78,7 @@ module Fog
:key => key
})
new(file_data)
rescue Fog::Rackspace::Storage::NotFound
rescue Fog::Storage::Rackspace::NotFound
nil
end

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class AccessControlList < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module Storage
module AWS
class CompleteMultipartUpload < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class CopyObject < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class GetBucket < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class GetBucketLocation < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class GetBucketLogging < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class GetBucketObjectVersions < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class GetBucketVersioning < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class GetBucketWebsite < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class GetRequestPayment < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class GetService < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class InitiateMultipartUpload < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class ListMultipartUploads < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module AWS
module Storage
module Storage
module AWS
class ListParts < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module Google
module Storage
module Storage
module Google
class AccessControlList < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module Google
module Storage
module Storage
module Google
class CopyObject < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module Google
module Storage
module Storage
module Google
class GetBucket < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module Google
module Storage
module Storage
module Google
class AccessControlList < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module Google
module Storage
module Storage
module Google
class GetBucketObjectVersions < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module Google
module Storage
module Storage
module Google
class GetBucketVersioning < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module Google
module Storage
module Storage
module Google
class GetRequestPayment < Fog::Parsers::Base

View file

@ -1,7 +1,7 @@
module Fog
module Parsers
module Google
module Storage
module Storage
module Google
class GetService < Fog::Parsers::Base

View file

@ -1,6 +1,6 @@
module Fog
module Rackspace
class Storage < Fog::Service
module Storage
class Rackspace < Fog::Service
requires :rackspace_api_key, :rackspace_username
recognizes :rackspace_auth_url, :rackspace_servicenet, :rackspace_cdn_ssl, :persistent
@ -50,13 +50,6 @@ module Fog
end
def initialize(options={})
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::Rackspace::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Rackspace') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
require 'mime/types'
@rackspace_api_key = options[:rackspace_api_key]
@rackspace_username = options[:rackspace_username]
@ -77,13 +70,6 @@ module Fog
attr_reader :rackspace_cdn_ssl
def initialize(options={})
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::Rackspace::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Rackspace') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
require 'mime/types'
require 'json'
@rackspace_api_key = options[:rackspace_api_key]
@ -118,7 +104,7 @@ module Fog
rescue Excon::Errors::HTTPStatusError => error
raise case error
when Excon::Errors::NotFound
Fog::Rackspace::Storage::NotFound.slurp(error)
Fog::Storage::Rackspace::NotFound.slurp(error)
else
error
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Abort a multipart upload

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/complete_multipart_upload'
@ -40,7 +40,7 @@ module Fog
:headers => { 'Content-Length' => data.length },
:host => "#{bucket_name}.#{@host}",
:method => 'POST',
:parser => Fog::Parsers::AWS::Storage::CompleteMultipartUpload.new,
:parser => Fog::Parsers::Storage::AWS::CompleteMultipartUpload.new,
:path => CGI.escape(object_name),
:query => {'uploadId' => upload_id}
})

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/copy_object'
@ -36,7 +36,7 @@ module Fog
:headers => headers,
:host => "#{target_bucket_name}.#{@host}",
:method => 'PUT',
:parser => Fog::Parsers::AWS::Storage::CopyObject.new,
:parser => Fog::Parsers::Storage::AWS::CopyObject.new,
:path => CGI.escape(target_object_name)
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Delete an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Delete policy for a bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Delete website configuration for a bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Delete an object from S3
@ -18,7 +18,7 @@ module Fog
def delete_object(bucket_name, object_name, options = {})
headers = options
request({
request({
:expects => 204,
:headers => headers,
:host => "#{bucket_name}.#{@host}",

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/get_bucket'
@ -50,7 +50,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetBucket.new,
:parser => Fog::Parsers::Storage::AWS::GetBucket.new,
:query => options
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/access_control_list'
@ -39,7 +39,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::AccessControlList.new,
:parser => Fog::Parsers::Storage::AWS::AccessControlList.new,
:query => {'acl' => nil}
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/get_bucket_location'
@ -25,7 +25,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetBucketLocation.new,
:parser => Fog::Parsers::Storage::AWS::GetBucketLocation.new,
:query => {'location' => nil}
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/get_bucket_logging'
@ -39,7 +39,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetBucketLogging.new,
:parser => Fog::Parsers::Storage::AWS::GetBucketLogging.new,
:query => {'logging' => nil}
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/get_bucket_object_versions'
@ -64,7 +64,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetBucketObjectVersions.new,
:parser => Fog::Parsers::Storage::AWS::GetBucketObjectVersions.new,
:query => {'versions' => nil}.merge!(options)
})
end

View file

@ -1,21 +1,21 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Get bucket policy for an S3 bucket
# Get bucket policy for an S3 bucket
#
# ==== Parameters
# * bucket_name<~String> - name of bucket to get policy for
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash> - policy document
#
# * body<~Hash> - policy document
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETpolicy.html
def get_bucket_policy(bucket_name)
def get_bucket_policy(bucket_name)
unless bucket_name
raise ArgumentError.new('bucket_name is required')
end
@ -27,11 +27,11 @@ module Fog
:method => 'GET',
:query => {'policy' => nil}
})
response.body = JSON.parse(response.body) unless response.body.nil?
response.body = JSON.parse(response.body) unless response.body.nil?
end
end
end
end
end
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/get_bucket_versioning'
@ -29,7 +29,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetBucketVersioning.new,
:parser => Fog::Parsers::Storage::AWS::GetBucketVersioning.new,
:query => {'versioning' => nil}
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/get_bucket_website'
@ -31,7 +31,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetBucketWebsite.new,
:parser => Fog::Parsers::Storage::AWS::GetBucketWebsite.new,
:query => {'website' => nil}
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Get an object from S3

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/access_control_list'
@ -49,7 +49,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::AccessControlList.new,
:parser => Fog::Parsers::Storage::AWS::AccessControlList.new,
:path => CGI.escape(object_name),
:query => query
})

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Get torrent for an S3 object

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Get an expiring object url from S3

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/get_request_payment'
@ -25,7 +25,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetRequestPayment.new,
:parser => Fog::Parsers::Storage::AWS::GetRequestPayment.new,
:query => {'requestPayment' => nil}
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/get_service'
@ -27,7 +27,7 @@ module Fog
:host => @host,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetService.new,
:parser => Fog::Parsers::Storage::AWS::GetService.new,
:url => @host
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Get headers for an object from S3

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/initiate_multipart_upload'
@ -35,7 +35,7 @@ module Fog
:headers => options,
:host => "#{bucket_name}.#{@host}",
:method => 'POST',
:parser => Fog::Parsers::AWS::Storage::InitiateMultipartUpload.new,
:parser => Fog::Parsers::Storage::AWS::InitiateMultipartUpload.new,
:path => CGI.escape(object_name),
:query => {'uploads' => nil}
})

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/list_multipart_uploads'
@ -49,7 +49,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::ListMultipartUploads.new,
:parser => Fog::Parsers::Storage::AWS::ListMultipartUploads.new,
:query => options.merge!({'uploads' => nil})
})
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
require 'fog/storage/parsers/aws/list_parts'
@ -47,7 +47,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::ListParts.new,
:parser => Fog::Parsers::Storage::AWS::ListParts.new,
:path => CGI.escape(object_name),
:query => options.merge!({'uploadId' => upload_id})
})

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Get a hash of hidden fields for form uploading to S3, in the form {:field_name => :field_value}

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Create an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Change access control list for an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Change logging status for an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Change bucket policy for an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Change versioning status for an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Change website configuration for an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Create an object in an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Change access control list for an S3 object

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Get an expiring object url from S3 for putting an object

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Change who pays for requests to an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Sync clock against S3 to avoid skew errors

View file

@ -1,6 +1,6 @@
module Fog
module AWS
class Storage
module Storage
class AWS
class Real
# Upload a part for a multipart upload

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
require 'fog/storage/parsers/google/copy_object'
@ -32,7 +32,7 @@ module Fog
:headers => headers,
:host => "#{target_bucket_name}.#{@host}",
:method => 'PUT',
:parser => Fog::Parsers::Google::Storage::CopyObject.new,
:parser => Fog::Parsers::Storage::Storage::CopyObject.new,
:path => CGI.escape(target_object_name)
})
end

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Delete an Google Storage bucket

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Delete an object from Google Storage

View file

@ -1,7 +1,7 @@
require 'pp'
module Fog
module Google
class Storage
module Storage
class Google
class Real
require 'fog/storage/parsers/google/get_bucket'
@ -48,7 +48,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Google::Storage::GetBucket.new,
:parser => Fog::Parsers::Storage::Google::GetBucket.new,
:query => options
})
end

View file

@ -36,7 +36,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Google::Storage::AccessControlList.new,
:parser => Fog::Parsers::Storage::Google::AccessControlList.new,
:query => {'acl' => nil}
})
end

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Get an object from Google Storage

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
require 'fog/storage/parsers/google/access_control_list'
@ -46,7 +46,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Google::Storage::AccessControlList.new,
:parser => Fog::Parsers::Storage::Google::AccessControlList.new,
:path => CGI.escape(object_name),
:query => query
})

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Get torrent for an Google Storage object

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Get an expiring object url from Google Storage

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
require 'fog/storage/parsers/google/get_service'
@ -23,7 +23,7 @@ module Fog
:host => @host,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Google::Storage::GetService.new,
:parser => Fog::Parsers::Storage::Google::GetService.new,
:url => @host
})
end

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Get headers for an object from Google Storage

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Create an Google Storage bucket

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Change access control list for an Google Storage bucket

View file

@ -1,6 +1,6 @@
module Fog
module Google
class Storage
module Storage
class Google
class Real
# Create an object in an Google Storage bucket

Some files were not shown because too many files have changed in this diff Show more