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.6.0 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
far-gem-0.5.6 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
far-gem-0.5.5 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
far-gem-0.5.4 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
far-gem-0.5.3 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
far-gem-0.5.2 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
far-gem-0.5.1 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb