Sha256: 449a5d7a0e1bcab95e80fd55baa862bd6d8130a91512fe2648d449e5207acb2a

Contents?: true

Size: 962 Bytes

Versions: 1

Compression:

Stored size: 962 Bytes

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def commit_blob_blocks(container_name, blob_name, blocks, options = {})
          options[:request_id] = SecureRandom.uuid
          msg = "commit_blob_blocks: Complete uploading #{blob_name} to the container #{container_name}. options: #{options}"
          Fog::Logger.debug msg

          begin
            @blob_client.commit_blob_blocks(container_name, blob_name, blocks, options)
          rescue Azure::Core::Http::HTTPError => ex
            raise_azure_exception(ex, msg)
          end

          Fog::Logger.debug "Block blob #{blob_name} is uploaded successfully."
          true
        end
      end

      # This class provides the mock implementation for unit tests.
      class Mock
        def commit_blob_blocks(*)
          true
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/requests/storage/commit_blob_blocks.rb