Class: Fog::Network::StormOnDemand::PrivateIps
- Inherits:
-
Collection
- Object
- Collection
- Fog::Network::StormOnDemand::PrivateIps
- Defined in:
- lib/fog/storm_on_demand/models/network/private_ips.rb
Instance Method Summary collapse
- #all ⇒ Object
- #attach(server_id) ⇒ Object
- #attached?(server_id) ⇒ Boolean
- #detach(server_id) ⇒ Object
- #get(server_id) ⇒ Object
Instance Method Details
#all ⇒ Object
10 11 12 13 |
# File 'lib/fog/storm_on_demand/models/network/private_ips.rb', line 10 def all data = service.list_private_ips.body['networks'] load(data) end |
#attach(server_id) ⇒ Object
19 20 21 22 |
# File 'lib/fog/storm_on_demand/models/network/private_ips.rb', line 19 def attach(server_id) res = service.attach_server_to_private_ip(:uniq_id => server_id).body res['attached'].to_i == 1 ? true : false end |
#attached?(server_id) ⇒ Boolean
29 30 31 32 |
# File 'lib/fog/storm_on_demand/models/network/private_ips.rb', line 29 def attached?(server_id) r = service.check_server_attached(:uniq_id => server_id).body r['is_attached'].to_i == 1 ? true : false end |
#detach(server_id) ⇒ Object
24 25 26 27 |
# File 'lib/fog/storm_on_demand/models/network/private_ips.rb', line 24 def detach(server_id) r = service.detach_server_from_private_ip(:uniq_id => server_id).body r['detached'].to_i == 1 ? true : false end |
#get(server_id) ⇒ Object
15 16 17 |
# File 'lib/fog/storm_on_demand/models/network/private_ips.rb', line 15 def get(server_id) service.get_private_ip(:uniq_id => server_id).body['ip'] end |