Sha256: ced023329d4a7d7e0be86344fde34128c21ad4da00328e8ab7e0fbc359c341fe

Contents?: true

Size: 999 Bytes

Versions: 2

Compression:

Stored size: 999 Bytes

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def get_blob_metadata(container_name, name)
          msg = "Getting Blob #{name} metadata in container #{container_name}."
          Fog::Logger.debug msg
          begin
              blob = @blob_client.get_blob_metadata(container_name, name)
            rescue Azure::Core::Http::HTTPError => ex
              raise_azure_exception(ex, msg)
          end
          Fog::Logger.debug "Getting metadata of blob #{name} successfully."
          blob.metadata
        end
      end
      # This class provides the mock implementation for unit tests.
      class Mock
        def get_blob_metadata(*)
          {
            'container-name' => 'testcontainer1',
            'blob-name' => 'testblob',
            'category' => 'Images',
            'resolution' => 'High'
          }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.6 lib/fog/azurerm/requests/storage/get_blob_metadata.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/requests/storage/get_blob_metadata.rb