Sha256: 6a854b528d5d9d3bd217a42696c281a09790788b8f34a55b40ee0db45f21ac32

Contents?: true

Size: 1.27 KB

Versions: 17

Compression:

Stored size: 1.27 KB

Contents

module Fog
  module Storage
    class AzureRM
      # Real class for Recovery Vault request
      class Real
        def delete_recovery_vault(resource_group, name)
          msg = "Deleting Recovery Vault #{name} from Resource Group #{resource_group}"
          Fog::Logger.debug msg
          resource_url = "#{AZURE_RESOURCE}/subscriptions/#{@subscription_id}/resourceGroups/#{resource_group}/providers/Microsoft.RecoveryServices/vaults/#{name}?api-version=#{REST_CLIENT_API_VERSION[1]}"
          begin
            token = Fog::Credentials::AzureRM.get_token(@tenant_id, @client_id, @client_secret)
            RestClient.delete(
              resource_url,
              accept: 'application/json',
              content_type: 'application/json',
              authorization: token
            )
          rescue RestClient::Exception => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Recovery Vault #{name} in Resource Group #{resource_group} deleted successfully"
          true
        end
      end

      # Mock class for Recovery Vault request
      class Mock
        def delete_recovery_vault(*)
          Fog::Logger.debug 'Recovery Vault TestVault in Resource Group TestRG deleted successfully'
          true
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.2.5 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.2.4 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.2.3 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.2.2 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.2.1 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb
fog-azure-rm-0.2.0 lib/fog/azurerm/requests/storage/delete_recovery_vault.rb