Sha256: 3f040117d3b284f30f545d7b7629255f2a0381fd5b661b9c123aca85b2e0586c
Contents?: true
Size: 1.48 KB
Versions: 22
Compression:
Stored size: 1.48 KB
Contents
module Fog module AWS class Storage class Real require 'fog/aws/parsers/storage/get_service' # List information about S3 buckets for authorized user # # @return [Excon::Response] response: # * body [Hash]: # * Buckets [Hash]: # * Name [String] - Name of bucket # * CreationTime [Time] - Timestamp of bucket creation # * Owner [Hash]: # * DisplayName [String] - Display name of bucket owner # * ID [String] - Id of bucket owner # # @see https://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html # def get_service request({ :expects => 200, :headers => {}, :host => 's3.amazonaws.com', :idempotent => true, :method => 'GET', :parser => Fog::Parsers::AWS::Storage::GetService.new }) end end class Mock # :nodoc:all 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 end end end end
Version data entries
22 entries across 22 versions & 1 rubygems