Class: Fog::Network::StormOnDemand::Balancers

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/network/storm_on_demand/models/balancers.rb

Instance Method Summary collapse

Instance Method Details

#all(options = {}) ⇒ Object



7
8
9
10
# File 'lib/fog/network/storm_on_demand/models/balancers.rb', line 7

def all(options = {})
  data = service.list_balancers(options).body["items"]
  load(data)
end

#available(name) ⇒ Object



12
13
14
15
# File 'lib/fog/network/storm_on_demand/models/balancers.rb', line 12

def available(name)
  avail = service.check_balancer_available(:name => name).body
  avail["available"].to_i == 1 ? true : false
end

#create(options) ⇒ Object



17
18
19
20
# File 'lib/fog/network/storm_on_demand/models/balancers.rb', line 17

def create(options)
  balancer = service.create_balancer(options).body
  new(balancer)
end

#get(uniq_id) ⇒ Object



22
23
24
25
# File 'lib/fog/network/storm_on_demand/models/balancers.rb', line 22

def get(uniq_id)
  balancer = service.get_balancer_details(:uniq_id => uniq_id).body
  new(balancer)
end

#possible_nodes(options = {}) ⇒ Object



27
28
29
# File 'lib/fog/network/storm_on_demand/models/balancers.rb', line 27

def possible_nodes(options = {})
  service.get_balancer_possible_nodes(options).body["items"]
end

#strategiesObject



31
32
33
# File 'lib/fog/network/storm_on_demand/models/balancers.rb', line 31

def strategies
  service.get_balancer_strategies.body["strategies"]
end