Sha256: a0a6b7f05916629b8ea144fe752fad5307cf6315b786648b5aa8e2dba69d57ea

Contents?: true

Size: 762 Bytes

Versions: 47

Compression:

Stored size: 762 Bytes

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def get_available_ipaddresses_count(subnet_name, address_prefix, ip_configurations_ids, express_route_enabled)
          Fog::Logger.debug "Getting free IP Address count of Subnet #{subnet_name}"
          total_ipaddresses = (2**(32 - address_prefix.split('/').last.to_i)) - 2
          total_ipaddresses -= 3 if express_route_enabled
          used_ip_address = ip_configurations_ids.nil? ? 0 : ip_configurations_ids.count
          total_ipaddresses - used_ip_address
        end
      end

      # Mock class for Network Request
      class Mock
        def get_available_ipaddress_count(*)
          65_531
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

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