Class: Wavefront::Alerting
- Inherits:
-
Object
- Object
- Wavefront::Alerting
- Includes:
- Constants, Mixins, Validators
- Defined in:
- lib/wavefront/alerting.rb
Constant Summary collapse
- DEFAULT_PATH =
'/api/alert/'
Constants included from Constants
Constants::ALERT_FORMATS, Constants::DEFAULT_ALERT_FORMAT, Constants::DEFAULT_FORMAT, Constants::DEFAULT_HOST, Constants::DEFAULT_INFILE_FORMAT, Constants::DEFAULT_OBSOLETE_METRICS, Constants::DEFAULT_OPTS, Constants::DEFAULT_PERIOD_SECONDS, Constants::DEFAULT_PREFIX_LENGTH, Constants::DEFAULT_PROXY, Constants::DEFAULT_PROXY_PORT, Constants::DEFAULT_SOURCE_FORMAT, Constants::DEFAULT_STRICT, Constants::EVENT_LEVELS, Constants::EVENT_STATE_DIR, Constants::FORMATS, Constants::GRANULARITIES, Constants::SOURCE_FORMATS
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#noop ⇒ Object
readonly
Returns the value of attribute noop.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
- #active(options = {}) ⇒ Object
- #affected_by_maintenance(options = {}) ⇒ Object
- #all(options = {}) ⇒ Object
-
#initialize(token, host = DEFAULT_HOST, debug = false, options = {}) ⇒ Alerting
constructor
A new instance of Alerting.
- #invalid(options = {}) ⇒ Object
- #snoozed(options = {}) ⇒ Object
Methods included from Mixins
#hash_to_qs, #interpolate_schema, #parse_time, #time_to_ms, #uri_concat
Methods included from Validators
#valid_path?, #valid_source?, #valid_string?, #valid_tags?, #valid_ts?, #valid_value?
Constructor Details
#initialize(token, host = DEFAULT_HOST, debug = false, options = {}) ⇒ Alerting
Returns a new instance of Alerting.
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/wavefront/alerting.rb', line 34 def initialize(token, host = DEFAULT_HOST, debug=false, = {}) # # Following existing convention, 'host' is the Wavefront API endpoint. # @headers = { :'X-AUTH-TOKEN' => token } @endpoint = host @token = token debug(debug) @noop = [:noop] @verbose = [:verbose] end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
32 33 34 |
# File 'lib/wavefront/alerting.rb', line 32 def endpoint @endpoint end |
#noop ⇒ Object (readonly)
Returns the value of attribute noop.
32 33 34 |
# File 'lib/wavefront/alerting.rb', line 32 def noop @noop end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
32 33 34 |
# File 'lib/wavefront/alerting.rb', line 32 def token @token end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
32 33 34 |
# File 'lib/wavefront/alerting.rb', line 32 def verbose @verbose end |
Instance Method Details
#active(options = {}) ⇒ Object
46 47 48 |
# File 'lib/wavefront/alerting.rb', line 46 def active(={}) get_alerts('active', ) end |
#affected_by_maintenance(options = {}) ⇒ Object
62 63 64 |
# File 'lib/wavefront/alerting.rb', line 62 def affected_by_maintenance(={}) get_alerts('affected_by_maintenance', ) end |
#all(options = {}) ⇒ Object
50 51 52 |
# File 'lib/wavefront/alerting.rb', line 50 def all(={}) get_alerts('all', ) end |
#invalid(options = {}) ⇒ Object
54 55 56 |
# File 'lib/wavefront/alerting.rb', line 54 def invalid(={}) get_alerts('invalid', ) end |
#snoozed(options = {}) ⇒ Object
58 59 60 |
# File 'lib/wavefront/alerting.rb', line 58 def snoozed(={}) get_alerts('snoozed', ) end |