Class: ProjectFifo::VM
Constant Summary collapse
- VALIDATIONS =
{ package: 'string', dataset: 'string', config: { alias: 'string', networks: { net0: 'string' } } }
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #get_by_alias(a) ⇒ Object
- #get_by_name(n) ⇒ Object
-
#initialize(fifo) ⇒ VM
constructor
A new instance of VM.
Methods inherited from Resource
#[], #create, #delete, #get, #list, #metadata, #post, #put
Constructor Details
#initialize(fifo) ⇒ VM
Returns a new instance of VM.
7 8 9 |
# File 'lib/project-fifo/vm.rb', line 7 def initialize(fifo) super(fifo, 'vms') end |
Instance Method Details
#get_by_alias(a) ⇒ Object
11 12 13 |
# File 'lib/project-fifo/vm.rb', line 11 def get_by_alias(a) list.map{|i| get(i) }.select{|i| i['config']['alias'] == a } end |
#get_by_name(n) ⇒ Object
15 16 17 |
# File 'lib/project-fifo/vm.rb', line 15 def get_by_name(n) get_by_alias(n) end |