Sha256: 30e17b00b9d4f1a1a906b4f08487b8c7aba41bdf06d30f2bfee3a42c3358121e

Contents?: true

Size: 1.05 KB

Versions: 38

Compression:

Stored size: 1.05 KB

Contents

module Fog
  module Compute
    class AzureRM
      # Real class for Compute Request
      class Real
        def revoke_access_to_managed_disk(resource_group_name, disk_name)
          msg = "Revoking access to Managed Disk: #{disk_name}"
          Fog::Logger.debug msg
          begin
            response = @compute_mgmt_client.disks.revoke_access(resource_group_name, disk_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Access revoked to managed disk: #{disk_name} successfully."
          response
        end
      end

      # Mock class for Compute Request
      class Mock
        def revoke_access_to_managed_disk(*)
          response = {
            'name' => 'revoke',
            'status' => 200,
            'error' => 'Error Details'
          }
          response_mapper = Azure::ARM::Compute::Models::OperationStatusResponse.mapper
          @compute_mgmt_client.deserialize(response_mapper, response, 'result.body')
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.1 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/compute/revoke_access_to_managed_disk.rb