Class: Fog::Storage::InternetArchive::Mock
- Inherits:
-
Object
- Object
- Fog::Storage::InternetArchive::Mock
- Includes:
- GetObjectHttpUrl, GetObjectHttpsUrl, GetObjectUrl, PutObjectUrl, Utils
- Defined in:
- lib/fog/internet_archive/requests/storage/get_bucket.rb,
lib/fog/internet_archive/storage.rb,
lib/fog/internet_archive/requests/storage/get_object.rb,
lib/fog/internet_archive/requests/storage/put_bucket.rb,
lib/fog/internet_archive/requests/storage/put_object.rb,
lib/fog/internet_archive/requests/storage/sync_clock.rb,
lib/fog/internet_archive/requests/storage/copy_object.rb,
lib/fog/internet_archive/requests/storage/get_service.rb,
lib/fog/internet_archive/requests/storage/head_object.rb,
lib/fog/internet_archive/requests/storage/delete_bucket.rb,
lib/fog/internet_archive/requests/storage/delete_object.rb,
lib/fog/internet_archive/requests/storage/get_bucket_acl.rb,
lib/fog/internet_archive/requests/storage/get_object_acl.rb,
lib/fog/internet_archive/requests/storage/get_object_url.rb,
lib/fog/internet_archive/requests/storage/put_bucket_acl.rb,
lib/fog/internet_archive/requests/storage/put_object_acl.rb,
lib/fog/internet_archive/requests/storage/put_object_url.rb,
lib/fog/internet_archive/requests/storage/get_bucket_cors.rb,
lib/fog/internet_archive/requests/storage/put_bucket_cors.rb,
lib/fog/internet_archive/requests/storage/put_bucket_website.rb,
lib/fog/internet_archive/requests/storage/get_bucket_location.rb,
lib/fog/internet_archive/requests/storage/get_object_http_url.rb,
lib/fog/internet_archive/requests/storage/get_request_payment.rb,
lib/fog/internet_archive/requests/storage/put_request_payment.rb,
lib/fog/internet_archive/requests/storage/get_object_https_url.rb,
lib/fog/internet_archive/requests/storage/delete_multiple_objects.rb
Overview
:nodoc:all
Instance Attribute Summary
Attributes included from Utils
Class Method Summary collapse
Instance Method Summary collapse
- #copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {}) ⇒ Object
- #data ⇒ Object
- #delete_bucket(bucket_name) ⇒ Object
- #delete_multiple_objects(bucket_name, object_names, options = {}) ⇒ Object
- #delete_object(bucket_name, object_name, options = {}) ⇒ Object
- #get_bucket(bucket_name, options = {}) ⇒ Object
- #get_bucket_acl(bucket_name) ⇒ Object
- #get_bucket_cors(bucket_name) ⇒ Object
- #get_bucket_location(bucket_name) ⇒ Object
- #get_object(bucket_name, object_name, options = {}, &block) ⇒ Object
- #get_object_acl(bucket_name, object_name, options = {}) ⇒ Object
- #get_request_payment(bucket_name) ⇒ Object
- #get_service ⇒ Object
- #head_object(bucket_name, object_name, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #put_bucket(bucket_name, options = {}) ⇒ Object
- #put_bucket_acl(bucket_name, acl) ⇒ Object
- #put_bucket_cors(bucket_name, cors) ⇒ Object
- #put_bucket_website(bucket_name, suffix, options = {}) ⇒ Object
- #put_object(bucket_name, object_name, data, options = {}) ⇒ Object
- #put_object_acl(bucket_name, object_name, acl, options = {}) ⇒ Object
- #put_request_payment(bucket_name, payer) ⇒ Object
- #reset_data ⇒ Object
- #setup_credentials(options) ⇒ Object
- #signature(params) ⇒ Object
-
#sync_clock ⇒ Object
:nodoc:all.
Methods included from GetObjectHttpsUrl
Methods included from GetObjectHttpUrl
Methods included from PutObjectUrl
Methods included from GetObjectUrl
Methods included from Utils
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
198 199 200 201 202 203 204 |
# File 'lib/fog/internet_archive/storage.rb', line 198 def initialize(={}) setup_credentials() [:region] ||= 'us-east-1' @host = [:host] || Fog::InternetArchive::API_DOMAIN_NAME @scheme = [:scheme] || 'http' @region = [:region] end |
Class Method Details
.acls(type) ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/fog/internet_archive/storage.rb', line 116 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 ⇒ Object
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/fog/internet_archive/storage.rb', line 177 def self.data @data ||= Hash.new do |hash, region| hash[region] = Hash.new do |region_hash, key| region_hash[key] = { :acls => { :bucket => {}, :object => {} }, :buckets => {}, :cors => { :bucket => {} } } end end end |
.reset ⇒ Object
194 195 196 |
# File 'lib/fog/internet_archive/storage.rb', line 194 def self.reset @data = nil end |
Instance Method Details
#copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {}) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/fog/internet_archive/requests/storage/copy_object.rb', line 47 def copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, = {}) response = Excon::Response.new source_bucket = self.data[:buckets][source_bucket_name] source_object = source_bucket && source_bucket[:objects][source_object_name] && source_bucket[:objects][source_object_name].first target_bucket = self.data[:buckets][target_bucket_name] acl = ['x-amz-acl'] || 'private' if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl) raise Excon::Errors::BadRequest.new('invalid x-amz-acl') else self.data[:acls][:object][target_bucket_name] ||= {} self.data[:acls][:object][target_bucket_name][target_object_name] = self.class.acls(acl) end if source_object && target_bucket response.status = 200 target_object = source_object.dup target_object.merge!({'Key' => target_object_name}) target_bucket[:objects][target_object_name] = [target_object] response.body = { 'ETag' => target_object['ETag'], 'LastModified' => Time.parse(target_object['Last-Modified']) } else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#data ⇒ Object
206 207 208 |
# File 'lib/fog/internet_archive/storage.rb', line 206 def data self.class.data[@region][@ia_access_key_id] end |
#delete_bucket(bucket_name) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fog/internet_archive/requests/storage/delete_bucket.rb', line 28 def delete_bucket(bucket_name) response = Excon::Response.new if self.data[:buckets][bucket_name].nil? response.status = 404 raise(Excon::Errors.status_error({:expects => 204}, response)) elsif self.data[:buckets][bucket_name] && !self.data[:buckets][bucket_name][:objects].empty? response.status = 409 raise(Excon::Errors.status_error({:expects => 204}, response)) else self.data[:buckets].delete(bucket_name) response.status = 204 end response end |
#delete_multiple_objects(bucket_name, object_names, options = {}) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/fog/internet_archive/requests/storage/delete_multiple_objects.rb', line 64 def delete_multiple_objects(bucket_name, object_names, = {}) response = Excon::Response.new if bucket = self.data[:buckets][bucket_name] response.status = 200 response.body = { 'DeleteResult' => [] } object_names.each do |object_name| response.body['DeleteResult'] << delete_object_helper(bucket, object_name) end else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#delete_object(bucket_name, object_name, options = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fog/internet_archive/requests/storage/delete_object.rb', line 34 def delete_object(bucket_name, object_name, = {}) response = Excon::Response.new if bucket = self.data[:buckets][bucket_name] response.status = 204 bucket[:objects].delete(object_name) else response.status = 404 raise(Excon::Errors.status_error({:expects => 204}, response)) end response end |
#get_bucket(bucket_name, options = {}) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/fog/internet_archive/requests/storage/get_bucket.rb', line 59 def get_bucket(bucket_name, = {}) prefix, marker, delimiter, max_keys = \ ['prefix'], ['marker'], ['delimiter'], ['max-keys'] common_prefixes = [] unless bucket_name raise ArgumentError.new('bucket_name is required') end response = Excon::Response.new if bucket = self.data[:buckets][bucket_name] contents = bucket[:objects].values.collect(&:first).sort {|x,y| x['Key'] <=> y['Key']}.reject do |object| (prefix && object['Key'][0...prefix.length] != prefix) || (marker && object['Key'] <= marker) || (delimiter && object['Key'][(prefix ? prefix.length : 0)..-1].include?(delimiter) \ && common_prefixes << object['Key'].sub(/^(#{prefix}[^#{delimiter}]+.).*/, '\1')) || object.has_key?(:delete_marker) end.map do |object| data = object.reject {|key, value| !['ETag', 'Key', 'StorageClass'].include?(key)} data.merge!({ 'LastModified' => Time.parse(object['Last-Modified']), 'Owner' => bucket['Owner'], 'Size' => object['Content-Length'].to_i }) data end max_keys = max_keys || 1000 size = [max_keys, 1000].min truncated_contents = contents[0...size] response.status = 200 response.body = { 'CommonPrefixes' => common_prefixes.uniq, 'Contents' => truncated_contents, 'IsTruncated' => truncated_contents.size != contents.size, 'Marker' => marker, 'MaxKeys' => max_keys, 'Name' => bucket['Name'], 'Prefix' => prefix } if max_keys && max_keys < response.body['Contents'].length response.body['IsTruncated'] = true response.body['Contents'] = response.body['Contents'][0...max_keys] end else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#get_bucket_acl(bucket_name) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/fog/internet_archive/requests/storage/get_bucket_acl.rb', line 50 def get_bucket_acl(bucket_name) response = Excon::Response.new if acl = self.data[:acls][:bucket][bucket_name] response.status = 200 if acl.is_a?(String) response.body = Fog::Storage::InternetArchive.acl_to_hash(acl) else response.body = acl end else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#get_bucket_cors(bucket_name) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/fog/internet_archive/requests/storage/get_bucket_cors.rb', line 46 def get_bucket_cors(bucket_name) response = Excon::Response.new if cors = self.data[:cors][:bucket][bucket_name] response.status = 200 if cors.is_a?(String) response.body = Fog::Storage::InternetArchive.cors_to_hash(cors) else response.body = cors end else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#get_bucket_location(bucket_name) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fog/internet_archive/requests/storage/get_bucket_location.rb', line 34 def get_bucket_location(bucket_name) response = Excon::Response.new if bucket = self.data[:buckets][bucket_name] location_constraint = case bucket['LocationConstraint'] when 'us-east-1' nil when 'eu-east-1' 'EU' else bucket['LocationConstraint'] end response.status = 200 response.body = {'LocationConstraint' => location_constraint } else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#get_object(bucket_name, object_name, options = {}, &block) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/fog/internet_archive/requests/storage/get_object.rb', line 61 def get_object(bucket_name, object_name, = {}, &block) unless bucket_name raise ArgumentError.new('bucket_name is required') end unless object_name raise ArgumentError.new('object_name is required') end response = Excon::Response.new if (bucket = self.data[:buckets][bucket_name]) object = nil if bucket[:objects].has_key?(object_name) object = bucket[:objects][object_name].first end if (object && !object[:delete_marker]) if ['If-Match'] && ['If-Match'] != object['ETag'] response.status = 412 elsif ['If-Modified-Since'] && ['If-Modified-Since'] >= Time.parse(object['Last-Modified']) response.status = 304 elsif ['If-None-Match'] && ['If-None-Match'] == object['ETag'] response.status = 304 elsif ['If-Unmodified-Since'] && ['If-Unmodified-Since'] < Time.parse(object['Last-Modified']) response.status = 412 else response.status = 200 for key, value in object case key when 'Cache-Control', 'Content-Disposition', 'Content-Encoding', 'Content-Length', 'Content-MD5', 'Content-Type', 'ETag', 'Expires', 'Last-Modified', /^x-amz-meta-/ response.headers[key] = value end end body = object[:body] if ['Range'] # since AWS S3 itself does not support multiple range headers, we will use only the first ranges = byte_ranges(['Range'], body.size) unless ranges.nil? || ranges.empty? response.status = 206 body = body[ranges.first] end end unless block_given? response.body = body else data = StringIO.new(body) remaining = data.length while remaining > 0 chunk = data.read([remaining, Excon::CHUNK_SIZE].min) block.call(chunk) remaining -= Excon::CHUNK_SIZE end end end else response.status = 404 response.body = "...<Code>NoSuchKey<\/Code>..." raise(Excon::Errors.status_error({:expects => 200}, response)) end else response.status = 404 response.body = "...<Code>NoSuchBucket</Code>..." raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#get_object_acl(bucket_name, object_name, options = {}) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/fog/internet_archive/requests/storage/get_object_acl.rb', line 57 def get_object_acl(bucket_name, object_name, = {}) response = Excon::Response.new if acl = self.data[:acls][:object][bucket_name] && self.data[:acls][:object][bucket_name][object_name] response.status = 200 if acl.is_a?(String) response.body = Fog::Storage::InternetArchive.acl_to_hash(acl) else response.body = acl end else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#get_request_payment(bucket_name) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fog/internet_archive/requests/storage/get_request_payment.rb', line 34 def get_request_payment(bucket_name) response = Excon::Response.new if bucket = self.data[:buckets][bucket_name] response.status = 200 response.body = { 'Payer' => bucket['Payer'] } else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#get_service ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fog/internet_archive/requests/storage/get_service.rb', line 36 def get_service response = Excon::Response.new response.headers['Status'] = 200 buckets = self.data[:buckets].values.map do |bucket| bucket.reject do |key, value| !['CreationDate', 'Name'].include?(key) end end response.body = { 'Buckets' => buckets, 'Owner' => { 'DisplayName' => 'owner', 'ID' => 'some_id'} } response end |
#head_object(bucket_name, object_name, options = {}) ⇒ Object
52 53 54 55 56 |
# File 'lib/fog/internet_archive/requests/storage/head_object.rb', line 52 def head_object(bucket_name, object_name, = {}) response = get_object(bucket_name, object_name, ) response.body = nil response end |
#put_bucket(bucket_name, options = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/fog/internet_archive/requests/storage/put_bucket.rb', line 43 def put_bucket(bucket_name, = {}) acl = ['x-amz-acl'] || 'private' if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl) raise Excon::Errors::BadRequest.new('invalid x-amz-acl') else self.data[:acls][:bucket][bucket_name] = self.class.acls(acl) end response = Excon::Response.new response.status = 200 bucket = { :objects => {}, 'Name' => bucket_name, 'CreationDate' => Time.now, 'Owner' => { 'DisplayName' => 'owner', 'ID' => 'some_id'}, 'Payer' => 'BucketOwner' } if ['LocationConstraint'] bucket['LocationConstraint'] = ['LocationConstraint'] else bucket['LocationConstraint'] = nil end unless self.data[:buckets][bucket_name] self.data[:buckets][bucket_name] = bucket end response end |
#put_bucket_acl(bucket_name, acl) ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/fog/internet_archive/requests/storage/put_bucket_acl.rb', line 57 def put_bucket_acl(bucket_name, acl) if acl.is_a?(Hash) self.data[:acls][:bucket][bucket_name] = Fog::Storage::InternetArchive.hash_to_acl(acl) else if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl) raise Excon::Errors::BadRequest.new('invalid x-amz-acl') end self.data[:acls][:bucket][bucket_name] = acl end end |
#put_bucket_cors(bucket_name, cors) ⇒ Object
42 43 44 |
# File 'lib/fog/internet_archive/requests/storage/put_bucket_cors.rb', line 42 def put_bucket_cors(bucket_name, cors) self.data[:cors][:bucket][bucket_name] = Fog::Storage::InternetArchive.hash_to_cors(cors) end |
#put_bucket_website(bucket_name, suffix, options = {}) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fog/internet_archive/requests/storage/put_bucket_website.rb', line 48 def put_bucket_website(bucket_name, suffix, = {}) response = Excon::Response.new if self.data[:buckets][bucket_name] response.status = 200 else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#put_object(bucket_name, object_name, data, options = {}) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/fog/internet_archive/requests/storage/put_object.rb', line 47 def put_object(bucket_name, object_name, data, = {}) acl = ['x-amz-acl'] || 'private' if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl) raise Excon::Errors::BadRequest.new('invalid x-amz-acl') else self.data[:acls][:object][bucket_name] ||= {} self.data[:acls][:object][bucket_name][object_name] = self.class.acls(acl) end data = Fog::Storage.parse_data(data) unless data[:body].is_a?(String) data[:body] = data[:body].read end response = Excon::Response.new if (bucket = self.data[:buckets][bucket_name]) response.status = 200 object = { :body => data[:body], 'Content-Type' => ['Content-Type'] || data[:headers]['Content-Type'], 'ETag' => Digest::MD5.hexdigest(data[:body]), 'Key' => object_name, 'Last-Modified' => Fog::Time.now.to_date_header, 'Content-Length' => ['Content-Length'] || data[:headers]['Content-Length'], } for key, value in case key when 'Cache-Control', 'Content-Disposition', 'Content-Encoding', 'Content-MD5', 'Expires', /^x-amz-meta-/, /^x-archive-/ object[key] = value end end bucket[:objects][object_name] = [object] response.headers = { 'Content-Length' => object['Content-Length'], 'Content-Type' => object['Content-Type'], 'ETag' => object['ETag'], 'Last-Modified' => object['Last-Modified'], } else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#put_object_acl(bucket_name, object_name, acl, options = {}) ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/fog/internet_archive/requests/storage/put_object_acl.rb', line 61 def put_object_acl(bucket_name, object_name, acl, = {}) if acl.is_a?(Hash) self.data[:acls][:object][bucket_name][object_name] = Fog::Storage::InternetArchive.hash_to_acl(acl) else if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl) raise Excon::Errors::BadRequest.new('invalid x-amz-acl') end self.data[:acls][:object][bucket_name][object_name] = acl end end |
#put_request_payment(bucket_name, payer) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fog/internet_archive/requests/storage/put_request_payment.rb', line 34 def put_request_payment(bucket_name, payer) response = Excon::Response.new if bucket = self.data[:buckets][bucket_name] response.status = 200 bucket['Payer'] = payer else response.status = 404 raise(Excon::Errors.status_error({:expects => 200}, response)) end response end |
#reset_data ⇒ Object
210 211 212 |
# File 'lib/fog/internet_archive/storage.rb', line 210 def reset_data self.class.data[@region].delete(@ia_access_key_id) end |
#setup_credentials(options) ⇒ Object
218 219 220 221 222 223 |
# File 'lib/fog/internet_archive/storage.rb', line 218 def setup_credentials() @ia_access_key_id = [:ia_access_key_id] @ia_secret_access_key = [:ia_secret_access_key] @ia_session_token = [:ia_session_token] @ia_credentials_expire_at = [:ia_credentials_expire_at] end |
#signature(params) ⇒ Object
214 215 216 |
# File 'lib/fog/internet_archive/storage.rb', line 214 def signature(params) "foo" end |
#sync_clock ⇒ Object
:nodoc:all
21 22 23 |
# File 'lib/fog/internet_archive/requests/storage/sync_clock.rb', line 21 def sync_clock true end |