Class: Bark::Client
- Inherits:
-
Object
- Object
- Bark::Client
- Defined in:
- lib/bark/client.rb
Overview
The Client class is the primary communicator between the program and the
Instance Attribute Summary collapse
-
#host ⇒ Object
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. -
#password ⇒ Object
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. -
#platform ⇒ `Bark::Platform`
readonly
Used for access to the platform section of the XML data.
-
#port ⇒ Object
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. -
#server ⇒ `Bark::Server`
readonly
Used for access to the server section of the XML data.
-
#service ⇒ `Bark::Service`
readonly
Used for access to the service section of the XML data.
-
#status ⇒ `Bark::Status`
readonly
Used for access to the top level XML data.
-
#user ⇒ Object
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.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
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
#host ⇒ Object (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 |
#password ⇒ Object (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
13 14 15 |
# File 'lib/bark/client.rb', line 13 def platform @platform end |
#port ⇒ Object (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
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
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
13 14 15 |
# File 'lib/bark/client.rb', line 13 def status @status end |
#user ⇒ Object (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 |