Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

Fog::Storage::AWS::Mock

Public Class Methods

acls(type) click to toggle source
# File lib/fog/storage/aws.rb, line 101
def self.acls(type)
  case type
  when 'private'
    {
      "AccessControlList" => [
        {
          "Permission" => "FULL_CONTROL",
          "Grantee" => {"DisplayName" => "me", "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"}
        }
      ],
      "Owner" => {"DisplayName" => "me", "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"}
    }
  when 'public-read'
    {
      "AccessControlList" => [
        {
          "Permission" => "FULL_CONTROL",
          "Grantee" => {"DisplayName" => "me", "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"}
        },
        {
          "Permission" => "READ",
          "Grantee" => {"URI" => "http://acs.amazonaws.com/groups/global/AllUsers"}
        }
      ],
      "Owner" => {"DisplayName" => "me", "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"}
    }
  when 'public-read-write'
    {
      "AccessControlList" => [
        {
          "Permission" => "FULL_CONTROL",
          "Grantee" => {"DisplayName" => "me", "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"}
        },
        {
          "Permission" => "READ",
          "Grantee" => {"URI" => "http://acs.amazonaws.com/groups/global/AllUsers"}
        },
        {
          "Permission" => "WRITE",
          "Grantee" => {"URI" => "http://acs.amazonaws.com/groups/global/AllUsers"}
        }
      ],
      "Owner" => {"DisplayName" => "me", "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"}
    }
  when 'authenticated-read'
    {
      "AccessControlList" => [
        {
          "Permission" => "FULL_CONTROL",
          "Grantee" => {"DisplayName" => "me", "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"}
        },
        {
          "Permission" => "READ",
          "Grantee" => {"URI" => "http://acs.amazonaws.com/groups/global/AuthenticatedUsers"}
        }
      ],
      "Owner" => {"DisplayName" => "me", "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"}
    }
  end
end
data() click to toggle source
# File lib/fog/storage/aws.rb, line 162
def self.data
  @data ||= Hash.new do |hash, region|
    hash[region] = Hash.new do |region_hash, key|
      region_hash[key] = {
        :acls => {
          :bucket => {},
          :object => {}
        },
        :buckets => {}
      }
    end
  end
end
new(options={}) click to toggle source
# File lib/fog/storage/aws.rb, line 180
def initialize(options={})
  require 'mime/types'
  @aws_access_key_id = options[:aws_access_key_id]
  @aws_secret_access_key = options[:aws_secret_access_key]
  options[:region] ||= 'us-east-1'
  @host = options[:host] || case options[:region]
  when 'ap-northeast-1'
    's3-ap-northeast-1.amazonaws.com'
  when 'ap-southeast-1'
    's3-ap-southeast-1.amazonaws.com'
  when 'eu-west-1'
    's3-eu-west-1.amazonaws.com'
  when 'us-east-1'
    's3.amazonaws.com'
  when 'us-west-1'
    's3-us-west-1.amazonaws.com'
  else
    raise ArgumentError, "Unknown region: #{options[:region].inspect}"
  end
  @region = options[:region]
end
reset() click to toggle source
# File lib/fog/storage/aws.rb, line 176
def self.reset
  @data = nil
end

Public Instance Methods

data() click to toggle source
# File lib/fog/storage/aws.rb, line 202
def data
  self.class.data[@region][@aws_access_key_id]
end
reset_data() click to toggle source
# File lib/fog/storage/aws.rb, line 206
def reset_data
  self.class.data[@region].delete(@aws_access_key_id)
end
signature(params) click to toggle source
# File lib/fog/storage/aws.rb, line 210
def signature(params)
  "foo"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.