Class: Yao::Cli::LBaaS::LB
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
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/yao/cli/lbaas/lb.rb', line 32 def create = %w(vip_network_id vip_port_id vip_subnet_id) unless .map{|s| [s]}.one? puts "Error: One of vip_network_id, vip_port_id, or vip_subnet_id must be specified." exit 1 end params = generate_params result = Yao::Resources::LoadBalancer.create params # fix: すぐに出力するとvip_port_idがnullなのでエラーになる #pretty_output(Yao::Resources::Dumper::LoadBalancer.dump(result)) end |
#list ⇒ Object
8 9 10 11 12 |
# File 'lib/yao/cli/lbaas/lb.rb', line 8 def list result = Yao::Resources::LoadBalancer.list pretty_output(Yao::Resources::Dumper::LoadBalancer.dump(result)) end |
#remove(uuid) ⇒ Object
58 59 60 |
# File 'lib/yao/cli/lbaas/lb.rb', line 58 def remove(uuid) Yao::Resources::LoadBalancer.delete(uuid) end |
#show(id_or_name) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/yao/cli/lbaas/lb.rb', line 15 def show(id_or_name) if is_uuid?(id_or_name) result = Yao::Resources::LoadBalancer.find id_or_name else result = Yao::Resources::LoadBalancer.list.select do |lb| lb.name == id_or_name end end pretty_output(Yao::Resources::Dumper::LoadBalancer.dump(result)) end |