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

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

Instance Method Summary collapse

Instance Method Details

#all(options = {}) ⇒ Object



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

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

#available(name) ⇒ Object



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

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

#create(options) ⇒ Object



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

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

#get(uniq_id) ⇒ Object



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

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

#possible_nodes(options = {}) ⇒ Object



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

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

#strategiesObject



34
35
36
# File 'lib/fog/storm_on_demand/models/network/balancers.rb', line 34

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