Class: Crowbar::Client::App::VirtualIP

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

Overview

A Thor based CLI wrapper for virtual 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, service, network, range, suggestion = nil) ⇒ Object

Virtual IP allocate command

It will try to allocate a virtual IP address for the specified service.

Parameters:

  • proposal (String)

    the proposal name

  • service (String)

    the service name

  • 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/virtual_ip.rb', line 46

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

#deallocate(proposal, service, network) ⇒ Object

Virtual IP deallocate command

It will try to deallocate a virtual IP address.

Parameters:

  • proposal (String)

    the proposal name

  • service (String)

    the service name

  • network (String)

    the network name



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

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