Class: Yao::Cli::LBaaS::Pool
- Defined in:
- lib/yao/cli/lbaas/pool.rb
Instance Method Summary collapse
- #create ⇒ Object
- #list ⇒ Object
- #remove(uuid) ⇒ Object
- #show(id_or_name) ⇒ Object
- #update(uuid) ⇒ Object
Methods inherited from Base
Instance Method Details
#create ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/yao/cli/lbaas/pool.rb', line 34 def create unless [[:listener_id], [:loadbalancer_id]].one? puts "Error: Either listener_id or loadbalancer_id must be specified." exit 1 end params = generate_params result = Yao::Resources::LoadBalancerPool.create params # fix: すぐに出力するとvip_port_idがnullなのでエラーになる #pretty_output(Yao::Resources::Dumper::LoadBalancerPool.dump(result)) end |
#list ⇒ Object
9 10 11 12 13 |
# File 'lib/yao/cli/lbaas/pool.rb', line 9 def list result = Yao::Resources::LoadBalancerPool.list pretty_output(Yao::Resources::Dumper::LoadBalancerPool.dump(result)) end |
#remove(uuid) ⇒ Object
59 60 61 |
# File 'lib/yao/cli/lbaas/pool.rb', line 59 def remove(uuid) Yao::Resources::LoadBalancerPool.destroy(uuid) end |
#show(id_or_name) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/yao/cli/lbaas/pool.rb', line 16 def show(id_or_name) if is_uuid?(id_or_name) result = Yao::Resources::LoadBalancerPool.find id_or_name else result = Yao::Resources::LoadBalancerPool.list.select do |lb| lb.name == id_or_name end end pretty_output(Yao::Resources::Dumper::LoadBalancerPool.dump(result)) end |