Class: Lease
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Lease
- Defined in:
- lib/mkit/app/model/lease.rb
Instance Method Summary collapse
Instance Method Details
#confirm ⇒ Object
11 12 13 |
# File 'lib/mkit/app/model/lease.rb', line 11 def confirm self.status = MKIt::PoolStatus::IN_USE end |
#down ⇒ Object
21 22 23 24 25 |
# File 'lib/mkit/app/model/lease.rb', line 21 def down MKIt::InterfaceHelper.down(name: interface_name) MKIt::InterfaceHelper.remove(name: interface_name, ctype: interface_type) self.status = MKIt::PoolStatus::RESERVED end |
#up ⇒ Object
15 16 17 18 19 |
# File 'lib/mkit/app/model/lease.rb', line 15 def up MKIt::InterfaceHelper.create(name: interface_name, ctype: interface_type) MKIt::InterfaceHelper.up(name: interface_name, ip: ip, mask: pool.netmask) self.status = MKIt::PoolStatus::IN_USE end |