Sha256: b213e7924ae991f0662ea7254b7dc033d54beb99dae0ccaa5d1ffe6434819e83

Contents?: true

Size: 1.69 KB

Versions: 20

Compression:

Stored size: 1.69 KB

Contents

module Fog
  module Google
    class Storage
      class Real

        require 'fog/google/parsers/storage/access_control_list'

        # Get access control list for an Google Storage bucket
        #
        # ==== Parameters
        # * bucket_name<~String> - name of bucket to get access control list for
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'AccessControlPolicy'<~Hash>
        #       * 'Owner'<~Hash>:
        #         * 'DisplayName'<~String> - Display name of object owner
        #         * 'ID'<~String> - Id of object owner
        #       * 'AccessControlList'<~Array>:
        #         * 'Grant'<~Hash>:
        #           * 'Grantee'<~Hash>:
        #              * 'DisplayName'<~String> - Display name of grantee
        #              * 'ID'<~String> - Id of grantee
        #             or
        #              * 'URI'<~String> - URI of group to grant access for
        #           * 'Permission'<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
        #
        def get_bucket_acl(bucket_name)
          unless bucket_name
            raise ArgumentError.new('bucket_name is required')
          end
          request({
            :expects    => 200,
            :headers    => {},
            :host       => "#{bucket_name}.#{@host}",
            :idempotent => true,
            :method     => 'GET',
            :parser     => Fog::Parsers::Google::Storage::AccessControlList.new,
            :query      => {'acl' => nil}
          })
        end

      end

      class Mock

        def get_bucket_acl(bucket_name)
          Fog::Mock.not_implemented
        end

      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fog-0.3.21 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.20 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.19 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.18 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.17 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.16 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.15 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.14 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.13 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.12 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.11 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.10 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.9 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.8 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.7 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.6 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.5 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.4 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.3 lib/fog/google/requests/storage/get_bucket_acl.rb
fog-0.3.2 lib/fog/google/requests/storage/get_bucket_acl.rb