Class: Dcmgr::Cli::Vlan
Constant Summary collapse
Instance Method Summary collapse
Instance Method Details
#add ⇒ Object
12 13 14 15 16 17 |
# File 'lib/dcmgr/cli/vlan.rb', line 12 def add UnknownUUIDError.raise([:account_id]) if M::Account[[:account_id]].nil? Error.raise("Tag_id already exists",100) unless M::VlanLease.find(:tag_id => [:tag_id]).nil? puts super(M::VlanLease,) end |
#del(uuid) ⇒ Object
20 21 22 |
# File 'lib/dcmgr/cli/vlan.rb', line 20 def del(uuid) super(M::VlanLease,uuid) end |
#modify(uuid) ⇒ Object
27 28 29 30 |
# File 'lib/dcmgr/cli/vlan.rb', line 27 def modify(uuid) UnknownUUIDError.raise([:account_id]) if [:account_id] && M::Account[[:account_id]].nil? super(M::VlanLease,uuid,) end |
#show(uuid = nil) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/dcmgr/cli/vlan.rb', line 33 def show(uuid=nil) if uuid lease = M::VlanLease[uuid] || UnknownUUIDError.raise(uuid) puts ERB.new(<<__END, nil, '-').result(binding) Vlan Lease UUID: <%= lease.canonical_uuid %> Account id: <%= lease.account_id %> Tag id: <%= lease.tag_id %> __END else puts ERB.new(<<__END, nil, '-').result(binding) <%- M::VlanLease.each { |row| -%> <%= row.canonical_uuid %>\t<%= row.account_id %>\t<%= row.tag_id %> <%- } -%> __END end end |