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

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

Instance Attribute Summary

Attributes inherited from Collection

#service

Instance Method Summary collapse

Methods inherited from Collection

#clear, #destroy, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Collection

Instance Method Details

#all(options = {}) ⇒ Object



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

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

#available(name) ⇒ Object



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

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

#create(options) ⇒ Object



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

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

#get(uniq_id) ⇒ Object



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

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

#possible_nodes(options = {}) ⇒ Object



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

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

#strategiesObject



36
37
38
# File 'lib/fog/storm_on_demand/models/network/balancers.rb', line 36

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