Sha256: 8de482c3bf6983d5f258e6765645f286df86ad162cd6571b1947178fc936e82f

Contents?: true

Size: 1016 Bytes

Versions: 3

Compression:

Stored size: 1016 Bytes

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def copy_blob_from_uri(destination_container, destination_blob, source_blob_uri, options = {})
          msg = "Copying blob: #{source_blob_uri} to container #{destination_container}"
          Fog::Logger.debug msg
          begin
            copy_status = @blob_client.copy_blob_from_uri(destination_container, destination_blob, source_blob_uri, 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_from_uri(*)
          {
            '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_from_uri.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb