Sha256: 9674aea0686e8324690387874cdb3fc535fac0be24919b8b4a37aa26569bf1a2

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implemention for service calls.
      class Real
        def get_container_metadata(name)
          Fog::Logger.debug "Get Container #{name} metadata."
          begin
            container = @blob_client.get_container_metadata(name)
            Fog::Logger.debug "Getting metadata of container #{name} successfully."
            container.metadata
          rescue Azure::Core::Http::HTTPError => ex
            raise "Exception in getting metadata of Container #{name}: #{ex.inspect}"
          end
        end
      end
      # This class provides the mock implementation for unit tests.
      class Mock
        def get_container_metadata(name)
          {
            'container-name' => name,
            'created-by' => 'User',
            'source-machine' => 'Test-machine',
            'category' => 'guidance',
            'doctype' => 'textDocuments'
          }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.4 lib/fog/azurerm/requests/storage/get_container_metadata.rb