Sha256: a04486453c6ae83447e2564d502b1e9199dab38396398e1134b9e1b023f42786

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

module Fog
  module Resources
    class AzureRM
      class Real
        def delete_resource_group(name)
          begin
            Fog::Logger.debug "Deleting Resource Group: #{name}."
            promise = @rmc.resource_groups.delete(name)
            promise.value!
            Fog::Logger.debug "Resource Group #{name} deleted successfully."
            true
          rescue  MsRestAzure::AzureOperationError => e
            msg = "Exception deleting Resource Group #{name}. #{e.body['error']['message']}"
            raise msg
          end
        end
      end

      class Mock
        def delete_resource_group(name)
          Fog::Logger.debug "Resource Group #{name} deleted successfully."
          return true
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.2 lib/fog/azurerm/requests/resources/delete_resource_group.rb