Sha256: 3af3b0291a59f09ae669ec0e41559f2bec8f05b12aec889a0f9c635eaf4ac293

Contents?: true

Size: 918 Bytes

Versions: 6

Compression:

Stored size: 918 Bytes

Contents

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

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

          Fog::Logger.debug "block_id #{block_id} is uploaded successfully."
          true
        end
      end

      # This class provides the mock implementation.
      class Mock
        def put_blob_block(*)
          true
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gitlab-fog-azure-rm-2.2.0 lib/fog/azurerm/requests/storage/put_blob_block.rb
gitlab-fog-azure-rm-2.1.0 lib/fog/azurerm/requests/storage/put_blob_block.rb
gitlab-fog-azure-rm-2.0.1 lib/fog/azurerm/requests/storage/put_blob_block.rb
gitlab-fog-azure-rm-2.0.0 lib/fog/azurerm/requests/storage/put_blob_block.rb
gitlab-fog-azure-rm-1.9.1 lib/fog/azurerm/requests/storage/put_blob_block.rb
gitlab-fog-azure-rm-1.9.0 lib/fog/azurerm/requests/storage/put_blob_block.rb