Class: Hotdog::Sources::BaseSource
- Inherits:
-
Object
- Object
- Hotdog::Sources::BaseSource
- Defined in:
- lib/hotdog/sources.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #add_tags(host_name, tags, options = {}) ⇒ Object
-
#api_key ⇒ Object
> String.
-
#application_key ⇒ Object
> String.
- #cancel_downtime(id, options = {}) ⇒ Object
- #detach_tags(host_name, options = {}) ⇒ Object
-
#endpoint ⇒ Object
> String.
- #get_all_downtimes(options = {}) ⇒ Object
- #get_all_tags(options = {}) ⇒ Object
- #get_host_tags(host_name, options = {}) ⇒ Object
-
#id ⇒ Object
> Integer.
-
#initialize(application) ⇒ BaseSource
constructor
A new instance of BaseSource.
-
#name ⇒ Object
> String.
- #schedule_downtime(scope, options = {}) ⇒ Object
- #update_tags(host_name, tags, options = {}) ⇒ Object
Constructor Details
#initialize(application) ⇒ BaseSource
Returns a new instance of BaseSource.
6 7 8 9 10 |
# File 'lib/hotdog/sources.rb', line 6 def initialize(application) @application = application @logger = application.logger = application. end |
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
11 12 13 |
# File 'lib/hotdog/sources.rb', line 11 def application @application end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
12 13 14 |
# File 'lib/hotdog/sources.rb', line 12 def logger @logger end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/hotdog/sources.rb', line 13 def end |
Instance Method Details
#add_tags(host_name, tags, options = {}) ⇒ Object
99 100 101 |
# File 'lib/hotdog/sources.rb', line 99 def (host_name, , ={}) raise(NotImplementedError) end |
#api_key ⇒ Object
> String
27 28 29 |
# File 'lib/hotdog/sources.rb', line 27 def api_key() #=> String [:api_key] end |
#application_key ⇒ Object
> String
31 32 33 |
# File 'lib/hotdog/sources.rb', line 31 def application_key() #=> String [:application_key] end |
#cancel_downtime(id, options = {}) ⇒ Object
39 40 41 |
# File 'lib/hotdog/sources.rb', line 39 def cancel_downtime(id, ={}) raise(NotImplementedError) end |
#detach_tags(host_name, options = {}) ⇒ Object
103 104 105 |
# File 'lib/hotdog/sources.rb', line 103 def (host_name, ={}) raise(NotImplementedError) end |
#endpoint ⇒ Object
> String
23 24 25 |
# File 'lib/hotdog/sources.rb', line 23 def endpoint() #=> String [:endpoint] end |
#get_all_downtimes(options = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/hotdog/sources.rb', line 43 def get_all_downtimes(={}) # # This should return some `Array<Hash<String,String>>` like follows # # ```json # [ # { # "recurrence": null, # "end": 1533593208, # "monitor_tags": [ # "*" # ], # "canceled": null, # "monitor_id": null, # "org_id": 12345, # "disabled": false, # "start": 1533592608, # "creator_id": 78913, # "parent_id": null, # "timezone": "UTC", # "active": false, # "scope": [ # "host:i-abcdef01234567890" # ], # "message": null, # "downtime_type": null, # "id": 278432422, # "updater_id": null # } # ] # ``` # raise(NotImplementedError) end |
#get_all_tags(options = {}) ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/hotdog/sources.rb', line 78 def (={}) # # This should return some `Hash<String,Array<String>>` like follows # # ```json # { # "tagname:tagvalue": [ # "foo", # "bar", # "baz" # ] # } # ``` # raise(NotImplementedError) end |
#get_host_tags(host_name, options = {}) ⇒ Object
95 96 97 |
# File 'lib/hotdog/sources.rb', line 95 def (host_name, ={}) raise(NotImplementedError) end |
#id ⇒ Object
> Integer
15 16 17 |
# File 'lib/hotdog/sources.rb', line 15 def id() #=> Integer raise(NotImplementedError) end |
#name ⇒ Object
> String
19 20 21 |
# File 'lib/hotdog/sources.rb', line 19 def name() #=> String raise(NotImplementedError) end |
#schedule_downtime(scope, options = {}) ⇒ Object
35 36 37 |
# File 'lib/hotdog/sources.rb', line 35 def schedule_downtime(scope, ={}) raise(NotImplementedError) end |
#update_tags(host_name, tags, options = {}) ⇒ Object
107 108 109 |
# File 'lib/hotdog/sources.rb', line 107 def (host_name, , ={}) raise(NotImplementedError) end |