Class: Crowbar::Client::App::Database

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

Overview

A Thor based CLI wrapper for batch 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

#connectString

Database connect command

it will connect to a remote Crowbar database before Crowbar installation. This command only works if Crowbar is not yet installed.

Returns:

  • (String)

    a formatted response from the server



135
136
137
138
139
140
141
# File 'lib/crowbar/client/app/database.rb', line 135

def connect
  Command::Database::Connect.new(
    *command_params
  ).execute
rescue => e
  catch_errors(e)
end

#createString

Database create command

it will set up a new Crowbar database before Crowbar installation. This command only works if Crowbar is not yet installed.

Returns:

  • (String)

    a formatted response from the server



60
61
62
63
64
65
66
# File 'lib/crowbar/client/app/database.rb', line 60

def create
  Command::Database::Create.new(
    *command_params
  ).execute
rescue => e
  catch_errors(e)
end

#testString

Database test command

it will test the connection to a remote Crowbar database before Crowbar installation. This command only works if Crowbar is not yet installed.

Returns:

  • (String)

    a formatted response from the server



210
211
212
213
214
215
216
# File 'lib/crowbar/client/app/database.rb', line 210

def test
  Command::Database::Test.new(
    *command_params
  ).execute
rescue => e
  catch_errors(e)
end