Sha256: 1d4c876bcbb71a1bec8bb3aef13920598a8de5c9efdfc140c3f59ab40d1d1d5b

Contents?: true

Size: 1.02 KB

Versions: 3

Compression:

Stored size: 1.02 KB

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def copy_blob(destination_container, destination_blob, source_container, source_blob, options = {})
          msg = "Copying blob: #{source_blob} from container #{source_container} to container #{destination_container}"
          Fog::Logger.debug msg
          begin
            copy_status = @blob_client.copy_blob(destination_container, destination_blob, source_container, source_blob, options)
          rescue Azure::Core::Http::HTTPError => ex
            raise_azure_exception(ex, msg)
          end
          Fog::Logger.debug "Blob #{destination_blob} copied successfully."
          copy_status
        end
      end

      # This class provides the mock implementation for unit tests.
      class Mock
        def copy_blob(*)
          {
            'copyId' => 'abc123',
            'copyStatus' => 'pending'
          }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/storage/copy_blob.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/storage/copy_blob.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/storage/copy_blob.rb