Sha256: 718ca2163a93323c00f3f8a92207b19c63212d7d4b38e6fe0fb495c18a53059e

Contents?: true

Size: 880 Bytes

Versions: 64

Compression:

Stored size: 880 Bytes

Contents

module Fog
  module Compute
    class Ecloud
      class VirtualMachineAssignedIp < Fog::Ecloud::Model
        identity :href

        attribute :network, :aliases => :Networks
        attribute :address

        def id
          href.scan(/\d+/)[0]
        end

        def network=(network)
          network = network.dup
          network_address = network[:Network]
          @network = self.service.networks.new(network_address)
          network_id = @network.href.match(/(\d+)$/)[1]
          address_ip = network_address[:IpAddresses][:IpAddress]
          @address = self.service.ip_addresses.new(
            :href => "#{service.base_path}/ipaddresses/networks/#{network_id}/#{address_ip}",
            :name => address_ip
          )
        end
        attr_reader :network

        def address=(address); end
        attr_reader :address
      end
    end
  end
end

Version data entries

64 entries across 62 versions & 7 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-ecloud-0.1.1/lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
fog-ecloud-0.3.0 lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
fog-ecloud-0.2.0 lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
fog-ecloud-0.1.3 lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
fog-ecloud-0.1.2 lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
fog-ecloud-0.1.1 lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
fog-ecloud-0.1.0 lib/fog/compute/ecloud/models/virtual_machine_assigned_ip.rb
fog-ecloud-0.0.2 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
fog-ecloud-0.0.1 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
fog-1.25.0 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
nsidc-fog-1.24.1 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
fog-1.24.0 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
ns-fog-1.22.11 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
ns-fog-1.22.10 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
ns-fog-1.22.9 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb
ns-fog-1.22.8 lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb