Class: Wavefront::SavedSearch
- Defined in:
- lib/wavefront-sdk/savedsearch.rb
Overview
View and manage Cloud Integrations. These are identified by a UUID.
Instance Attribute Summary
Attributes inherited from CoreApi
#api, #creds, #logger, #opts, #update_keys
Instance Method Summary collapse
-
#create(body) ⇒ Wavefront::Response
POST /api/v2/savedsearch Create a saved search.
-
#delete(id) ⇒ Wavefront::Response
DELETE /api/v2/savedsearch/id Delete a specific saved search.
-
#describe(id) ⇒ Wavefront::Response
GET /api/v2/savedsearch/id Get a specific saved search.
-
#entity(entitytype, offset = 0, limit = 100) ⇒ Wavefront::Response
GET /api/v2/savedsearch/type/entitytype Get all saved searches for a specific entity type for a user.
-
#list(offset = 0, limit = 100) ⇒ Wavefront::Response
GET /api/v2/savedsearch Get all saved searches for a user.
-
#update(id, body) ⇒ Object
PUT /api/v2/savedsearch/id Update a specific saved search.
Methods inherited from CoreApi
#api_base, #api_path, #hash_for_update, #initialize, #setup_api, #time_to_ms
Methods included from Mixins
#log, #parse_relative_time, #parse_time, #relative_time, #time_multiplier, #valid_relative_time?
Methods included from Validators
#wf_alert_id?, #wf_alert_severity?, #wf_cloudintegration_id?, #wf_dashboard_id?, #wf_derivedmetric_id?, #wf_distribution?, #wf_distribution_count?, #wf_distribution_interval?, #wf_distribution_values?, #wf_epoch?, #wf_event_id?, #wf_granularity?, #wf_integration_id?, #wf_link_id?, #wf_link_template?, #wf_maintenance_window_id?, #wf_message_id?, #wf_metric_name?, #wf_ms_ts?, #wf_name?, #wf_notificant_id?, #wf_point?, #wf_point_tag?, #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::CoreApi
Instance Method Details
#create(body) ⇒ Wavefront::Response
POST /api/v2/savedsearch Create a saved search. Refer to the Swagger API docs for valid keys.
27 28 29 30 |
# File 'lib/wavefront-sdk/savedsearch.rb', line 27 def create(body) raise ArgumentError unless body.is_a?(Hash) api.post('', body, 'application/json') end |
#delete(id) ⇒ Wavefront::Response
DELETE /api/v2/savedsearch/id Delete a specific saved search.
38 39 40 41 |
# File 'lib/wavefront-sdk/savedsearch.rb', line 38 def delete(id) wf_savedsearch_id?(id) api.delete(id) end |
#describe(id) ⇒ Wavefront::Response
GET /api/v2/savedsearch/id Get a specific saved search.
49 50 51 52 |
# File 'lib/wavefront-sdk/savedsearch.rb', line 49 def describe(id) wf_savedsearch_id?(id) api.get(id) end |
#entity(entitytype, offset = 0, limit = 100) ⇒ Wavefront::Response
GET /api/v2/savedsearch/type/entitytype Get all saved searches for a specific entity type for a user.
74 75 76 77 78 |
# File 'lib/wavefront-sdk/savedsearch.rb', line 74 def entity(entitytype, offset = 0, limit = 100) wf_savedsearch_entity?(entitytype) api.get(['type', entitytype].uri_concat, offset: offset, limit: limit) end |
#list(offset = 0, limit = 100) ⇒ Wavefront::Response
GET /api/v2/savedsearch Get all saved searches for a user.
16 17 18 |
# File 'lib/wavefront-sdk/savedsearch.rb', line 16 def list(offset = 0, limit = 100) api.get('', offset: offset, limit: limit) end |
#update(id, body) ⇒ Object
PUT /api/v2/savedsearch/id Update a specific saved search.
60 61 62 63 64 |
# File 'lib/wavefront-sdk/savedsearch.rb', line 60 def update(id, body) wf_savedsearch_id?(id) raise ArgumentError unless body.is_a?(Hash) api.put(id, body) end |