Sha256: 88b7d8a014bfcfd60f8f13fc9fc21a2a8a019bb768c569826d7abda806542399

Contents?: true

Size: 1005 Bytes

Versions: 51

Compression:

Stored size: 1005 Bytes

Contents

require 'fog/core/collection'
require 'fog/storm_on_demand/models/network/private_ip'

module Fog
  module Network
    class StormOnDemand

      class PrivateIps < Fog::Collection

        model Fog::Network::StormOnDemand::PrivateIp

        def all
          data = service.list_private_ips.body['networks']
          load(data)
        end

        def get(server_id)
          service.get_private_ip(:uniq_id => server_id).body['ip']
        end

        def attach(server_id)
          res = service.attach_server_to_private_ip(:uniq_id => server_id).body
          res['attached'].to_i == 1 ? true : false
        end

        def detach(server_id)
          r = service.detach_server_from_private_ip(:uniq_id => server_id).body
          r['detached'].to_i == 1 ? true : false
        end

        def attached?(server_id)
          r = service.check_server_attached(:uniq_id => server_id).body
          r['is_attached'].to_i == 1 ? true : false
        end
        
      end

    end
  end
end

Version data entries

51 entries across 51 versions & 3 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-1.20.0 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-1.19.0 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/storm_on_demand/models/network/private_ips.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/storm_on_demand/models/network/private_ips.rb