Class: VolumesController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  options = {
    display_name: naming.generate_name(nil, nil),
    volume_type: "SATA",
    size: 100
  }
  volumes.create options
end

#destroyObject



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

def destroy
  #Must be detached from servers
  volume.tap do |v|
    v.destroy
  end
end

#indexObject



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

def index
  volumes.all
end

#showObject



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

def show
  volume
end