Class: Wavefront::Search
Overview
Manage and query Wavefront searches. The /search API path has a lot of paths, with a lot of duplication. The current state of this class covers the whole API with two methods, but leaves a lot up to the user. It may grow, with convenience methods.
Instance Attribute Summary
Attributes inherited from Base
#api_base, #conn, #debug, #logger, #net, #noop, #opts, #update_keys, #verbose
Instance Method Summary collapse
- #facet_search(entity = nil, body = nil, deleted = false, facet = false) ⇒ Object
-
#search(entity = nil, body = nil, deleted = false) ⇒ Object
POST /api/v2/search/agent POST /api/v2/search/agent/deleted Run a search query.
Methods inherited from Base
#api_delete, #api_get, #api_post, #api_put, #hash_for_update, #initialize, #log, #mk_conn, #respond, #time_to_ms
Methods included from Mixins
Methods included from Validators
#wf_alert_id?, #wf_alert_severity?, #wf_cloudintegration_id?, #wf_dashboard_id?, #wf_epoch?, #wf_event_id?, #wf_granularity?, #wf_link_id?, #wf_link_template?, #wf_maintenance_window_id?, #wf_message_id?, #wf_metric_name?, #wf_ms_ts?, #wf_name?, #wf_point?, #wf_point_tags?, #wf_proxy_id?, #wf_savedsearch_entity?, #wf_savedsearch_id?, #wf_source_id?, #wf_string?, #wf_tag?, #wf_ts?, #wf_user_id?, #wf_value?, #wf_version?, #wf_webhook_id?
Constructor Details
This class inherits a constructor from Wavefront::Base
Instance Method Details
#facet_search(entity = nil, body = nil, deleted = false, facet = false) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/wavefront-sdk/search.rb', line 42 def facet_search(entity = nil, body = nil, deleted = false, facet = false) raise ArgumentError unless entity.is_a?(String) raise ArgumentError unless body.is_a?(Hash) path = ['agent'] path.<< 'deleted' if deleted path.<< facet ? facet : 'facets' api_post(path, body, 'application/json') end |
#search(entity = nil, body = nil, deleted = false) ⇒ Object
POST /api/v2/search/agent POST /api/v2/search/agent/deleted Run a search query. This single method maps to many API paths.
23 24 25 26 27 28 29 |
# File 'lib/wavefront-sdk/search.rb', line 23 def search(entity = nil, body = nil, deleted = false) raise ArgumentError unless entity.is_a?(String) raise ArgumentError unless body.is_a?(Hash) path = ['agent'] path.<< 'deleted' if deleted api_post(path, body, 'application/json') end |