Sha256: 022c6a57a56986bfab8437b2575ed973919c68d7cc351e0babb1f2dcd5f388d4

Contents?: true

Size: 899 Bytes

Versions: 3

Compression:

Stored size: 899 Bytes

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def delete_load_balancer(resource_group, name)
          Fog::Logger.debug "Deleting Load_Balancer #{name} from Resource Group #{resource_group}."
          begin
            promise = @network_client.load_balancers.delete(resource_group, name)
            promise.value!
            Fog::Logger.debug "Load_Balancer #{name} Deleted Successfully."
            true
          rescue  MsRestAzure::AzureOperationError => e
            msg = "Exception deleting Load_Balancer #{name} in Resource Group: #{resource_group}. #{e.body['error']['message']}"
            raise msg
          end
        end
      end

      # Mock class for Network Request
      class Mock
        def delete_load_balancer(_resource_group, _name)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.4 lib/fog/azurerm/requests/network/delete_load_balancer.rb
fog-azure-rm-0.0.3 lib/fog/azurerm/requests/network/delete_load_balancer.rb
fog-azure-rm-0.0.2 lib/fog/azurerm/requests/network/delete_load_balancer.rb