Class: Crowbar::Client::Command::Database::Connect
- Includes:
- Mixin::Database
- Defined in:
- lib/crowbar/client/command/database/connect.rb
Overview
Implementation for the database connect command
Constant Summary
Constants included from Mixin::Database
Mixin::Database::REGEX_DATABASE, Mixin::Database::REGEX_HOSTNAME, Mixin::Database::REGEX_IPV4, Mixin::Database::REGEX_PASSWORD, Mixin::Database::REGEX_PORT, Mixin::Database::REGEX_USERNAME
Instance Attribute Summary
Attributes inherited from Base
#args, #options, #stderr, #stdin, #stdout
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Crowbar::Client::Command::Base
Instance Method Details
#args_with_options ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/crowbar/client/command/database/connect.rb', line 29 def args.easy_merge!( db_username: .db_username, db_password: .db_password, database: .database, host: .host, port: .port ) end |
#execute ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/crowbar/client/command/database/connect.rb', line 45 def execute request.process do |request| case request.code when 200 say "Successfully connected to database" else err request.parsed_response["error"] end end end |