Class: Hotdog::Sources::BaseSource

Inherits:
Object
  • Object
show all
Defined in:
lib/hotdog/sources.rb

Direct Known Subclasses

Datadog

Instance Attribute Summary collapse

Instance Method Summary collapse

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
  @options = application.options
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



11
12
13
# File 'lib/hotdog/sources.rb', line 11

def application
  @application
end

#loggerObject (readonly)

Returns the value of attribute logger.



12
13
14
# File 'lib/hotdog/sources.rb', line 12

def logger
  @logger
end

#optionsObject (readonly)

Returns the value of attribute options.



13
14
15
# File 'lib/hotdog/sources.rb', line 13

def options
  @options
end

Instance Method Details

#add_tags(host_name, tags, options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


99
100
101
# File 'lib/hotdog/sources.rb', line 99

def add_tags(host_name, tags, options={})
  raise(NotImplementedError)
end

#api_keyObject

> String



27
28
29
# File 'lib/hotdog/sources.rb', line 27

def api_key() #=> String
  options[:api_key]
end

#application_keyObject

> String



31
32
33
# File 'lib/hotdog/sources.rb', line 31

def application_key() #=> String
  options[:application_key]
end

#cancel_downtime(id, options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/hotdog/sources.rb', line 39

def cancel_downtime(id, options={})
  raise(NotImplementedError)
end

#detach_tags(host_name, options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


103
104
105
# File 'lib/hotdog/sources.rb', line 103

def detach_tags(host_name, options={})
  raise(NotImplementedError)
end

#endpointObject

> String



23
24
25
# File 'lib/hotdog/sources.rb', line 23

def endpoint() #=> String
  options[:endpoint]
end

#get_all_downtimes(options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


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(options={})
  #
  # 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

Raises:

  • (NotImplementedError)


78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/hotdog/sources.rb', line 78

def get_all_tags(options={})
  #
  # 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

Raises:

  • (NotImplementedError)


95
96
97
# File 'lib/hotdog/sources.rb', line 95

def get_host_tags(host_name, options={})
  raise(NotImplementedError)
end

#idObject

> Integer

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/hotdog/sources.rb', line 15

def id() #=> Integer
  raise(NotImplementedError)
end

#nameObject

> String

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/hotdog/sources.rb', line 19

def name() #=> String
  raise(NotImplementedError)
end

#schedule_downtime(scope, options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/hotdog/sources.rb', line 35

def schedule_downtime(scope, options={})
  raise(NotImplementedError)
end

#update_tags(host_name, tags, options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


107
108
109
# File 'lib/hotdog/sources.rb', line 107

def update_tags(host_name, tags, options={})
  raise(NotImplementedError)
end