Class: Crowbar::Client::App::HostIP

Inherits:
Base
  • Object
show all
Defined in:
lib/crowbar/client/app/host_ip.rb

Overview

A Thor based CLI wrapper for host IP commands

Instance Method Summary collapse

Methods inherited from Base

banner, handle_argument_error, #initialize

Constructor Details

This class inherits a constructor from Crowbar::Client::App::Base

Instance Method Details

#allocate(proposal, node, network, range, suggestion = nil) ⇒ Object

Host IP allocate command

It will try to allocate a host IP address for the specified node.

Parameters:

  • proposal (String)

    the proposal name

  • node (String)

    the node name or alias

  • network (String)

    the network name

  • range (String)

    the network range

  • suggestion (String) (defaults to: nil)

    an optional suggestion



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/crowbar/client/app/host_ip.rb', line 46

def allocate(proposal, node, network, range, suggestion = nil)
  Command::HostIP::Allocate.new(
    *command_params(
      proposal: proposal,
      node: node,
      network: network,
      range: range,
      suggestion: suggestion
    )
  ).execute
rescue => e
  catch_errors(e)
end

#deallocate(proposal, node, network) ⇒ Object

Host IP deallocate command

It will try to deallocate a host IP address.

Parameters:

  • proposal (String)

    the proposal name

  • node (String)

    the node name or alias

  • network (String)

    the network name



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/crowbar/client/app/host_ip.rb', line 77

def deallocate(proposal, node, network)
  Command::HostIP::Deallocate.new(
    *command_params(
      proposal: proposal,
      node: node,
      network: network
    )
  ).execute
rescue => e
  catch_errors(e)
end