Sha256: a0e2f4c67ffcfb98a99fd32926270b58161f54347a1da56f68fb2f2d0bba7645

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_blob_metadata(container_name, name)
          Fog::Logger.debug "Get Blob #{name} metadata in container #{container_name}."
          begin
              blob = @blob_client.get_blob_metadata(container_name, name)
              Fog::Logger.debug "Getting metadata of blob #{name} successfully."
              blob.metadata
            rescue Azure::Core::Http::HTTPError => ex
              raise "Exception in getting metadata of Blob #{name}: #{ex.inspect}"
            end
        end
      end
      # This class provides the mock implementation for unit tests.
      class Mock
        def get_blob_metadata(container_name, name)
          {
            'container-name' => container_name,
            'blob-name' => name,
            'category' => 'Images',
            'resolution' => 'High'
          }
        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_blob_metadata.rb