Class: Bark::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/bark/client.rb

Overview

The Client class is the primary communicator between the program and the

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Client

Returns a new instance of Client.



14
15
16
17
18
# File 'lib/bark/client.rb', line 14

def initialize(opts = {})
  default_if_opts_nil opts
  @client = Hurley::Client.new "http://#{@user}:#{@password}"\
                               "@#{@host}:#{@port}"
end

Instance Attribute Details

#hostObject (readonly)

:host = The hostname of the Monit server :port = The port used to connect to the Monit server :user = The username used for basic auth with Monit server :password = The password used for basic auth with Monit server :status = The status xml api endpoint client :server = The server section retrieved via the status xml api :platform = The platform section retrieved via the status xml api :service = The service section retrieved via the status xml api



13
14
15
# File 'lib/bark/client.rb', line 13

def host
  @host
end

#passwordObject (readonly)

:host = The hostname of the Monit server :port = The port used to connect to the Monit server :user = The username used for basic auth with Monit server :password = The password used for basic auth with Monit server :status = The status xml api endpoint client :server = The server section retrieved via the status xml api :platform = The platform section retrieved via the status xml api :service = The service section retrieved via the status xml api



13
14
15
# File 'lib/bark/client.rb', line 13

def password
  @password
end

#platform`Bark::Platform` (readonly)

Used for access to the platform section of the XML data

Returns:



13
14
15
# File 'lib/bark/client.rb', line 13

def platform
  @platform
end

#portObject (readonly)

:host = The hostname of the Monit server :port = The port used to connect to the Monit server :user = The username used for basic auth with Monit server :password = The password used for basic auth with Monit server :status = The status xml api endpoint client :server = The server section retrieved via the status xml api :platform = The platform section retrieved via the status xml api :service = The service section retrieved via the status xml api



13
14
15
# File 'lib/bark/client.rb', line 13

def port
  @port
end

#server`Bark::Server` (readonly)

Used for access to the server section of the XML data

Returns:



13
14
15
# File 'lib/bark/client.rb', line 13

def server
  @server
end

#service`Bark::Service` (readonly)

Used for access to the service section of the XML data

Returns:



13
14
15
# File 'lib/bark/client.rb', line 13

def service
  @service
end

#status`Bark::Status` (readonly)

Used for access to the top level XML data

Returns:



13
14
15
# File 'lib/bark/client.rb', line 13

def status
  @status
end

#userObject (readonly)

:host = The hostname of the Monit server :port = The port used to connect to the Monit server :user = The username used for basic auth with Monit server :password = The password used for basic auth with Monit server :status = The status xml api endpoint client :server = The server section retrieved via the status xml api :platform = The platform section retrieved via the status xml api :service = The service section retrieved via the status xml api



13
14
15
# File 'lib/bark/client.rb', line 13

def user
  @user
end