class Crowbar::Client::Request::Database::Test

Implementation for the database test request

Public Instance Methods

content() click to toggle source

Override the request content

@return [Hash] the content for the request

Calls superclass method Crowbar::Client::Request::Base#content
# File lib/crowbar/client/request/database/test.rb, line 43
def content
  super.easy_merge!(
    username: attrs.db_username,
    password: attrs.db_password,
    database: attrs.database,
    host: attrs.host,
    port: attrs.port
  )
end
headers() click to toggle source

Override the request headers

@return [Hash] the headers for the request

Calls superclass method Crowbar::Client::Request::Base#headers
# File lib/crowbar/client/request/database/test.rb, line 32
def headers
  super.easy_merge!(
    ::Crowbar::Client::Util::ApiVersion.new(2.0).headers
  )
end
method() click to toggle source

HTTP method that gets used by the request

@return [Symbol] the method for the request

# File lib/crowbar/client/request/database/test.rb, line 58
def method
  :post
end
url() click to toggle source

Path to the API endpoint for the request

@return [String] path to the API endpoint

# File lib/crowbar/client/request/database/test.rb, line 67
def url
  [
    "api",
    "database",
    "test"
  ].join("/")
end