Class: InstancesController

Inherits:
MVCLI::Controller
  • Object
show all
Defined in:
app/controllers/instances_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



14
15
16
17
18
19
20
21
# File 'app/controllers/instances_controller.rb', line 14

def create
  options = {
    name: naming.generate_name('d', 'i'),
    flavor_id: 1,
    volume_size: 1,
  }
  instances.create options
end

#destroyObject



23
24
25
26
27
# File 'app/controllers/instances_controller.rb', line 23

def destroy
  instance.tap do |i|
    i.destroy
  end
end

#indexObject



6
7
8
# File 'app/controllers/instances_controller.rb', line 6

def index
  instances.all
end

#showObject



10
11
12
# File 'app/controllers/instances_controller.rb', line 10

def show
  instance
end