Class: NodesController

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

Instance Method Summary collapse

Instance Method Details

#createObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/nodes_controller.rb', line 18

def create
  template = Nodes::CreateForm
  argv = MVCLI::Argv.new command.argv
  form = template.new argv.options
  form.validate!

  n = nodes
  n.load_balancer = load_balancer
  options = {
    address: form.address,
    condition: form.condition,
    port: form.port,
    type: form.type
  }
  n.create options
end

#destroyObject



35
36
37
38
39
40
# File 'app/controllers/nodes_controller.rb', line 35

def destroy
  n = nodes
  n.load_balancer = load_balancer
  find_node_in(n).destroy
  params[:id]
end

#indexObject



6
7
8
9
10
# File 'app/controllers/nodes_controller.rb', line 6

def index
  n = nodes
  n.load_balancer = load_balancer
  n.all
end

#showObject



12
13
14
15
16
# File 'app/controllers/nodes_controller.rb', line 12

def show
  n = nodes
  n.load_balancer = load_balancer
  find_node_in n
end