Sha256: 9aabfac5b32faf10b8dd80bceb141173c999a0c56a22bbf5b22d7a1e53ab3dd6

Contents?: true

Size: 1.07 KB

Versions: 48

Compression:

Stored size: 1.07 KB

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        # Delete a disk in Azure storage.
        #
        # @param disk_name [String] Name of disk
        # @param options  [Hash]
        # @option options [String] container_name Sets name of the container which contains the disk. Default is 'vhds'.
        #
        # @return [Boolean]
        #
        def delete_disk(disk_name, options = {})
          msg = "Deleting disk(#{disk_name}). options: #{options}"
          Fog::Logger.debug msg

          container_name = options.delete(:container_name)
          container_name = 'vhds' if container_name.nil?
          delete_blob(container_name, "#{disk_name}.vhd")

          Fog::Logger.debug "Successfully deleted Disk: #{disk_name}."
          true
        end
      end

      # This class provides the mock implementation for unit tests.
      class Mock
        def delete_disk(*)
          Fog::Logger.debug 'Successfully deleted Disk'
          true
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 5 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/requests/storage/delete_disk.rb
gitlab-fog-azure-rm-0.6.0 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/storage/delete_disk.rb
far-gem-0.5.6 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/storage/delete_disk.rb
far-gem-0.5.5 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/storage/delete_disk.rb
far-gem-0.5.4 lib/fog/azurerm/requests/storage/delete_disk.rb
far-gem-0.5.3 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/storage/delete_disk.rb
far-gem-0.5.2 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/requests/storage/delete_disk.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/requests/storage/delete_disk.rb
far-gem-0.5.1 lib/fog/azurerm/requests/storage/delete_disk.rb