Class: Wavefront::ExternalLink
- Defined in:
- lib/wavefront-sdk/externallink.rb
Overview
Manage and query Wavefront external links.
Instance Attribute Summary
Attributes inherited from Base
#conn, #debug, #logger, #net, #noop, #opts, #verbose
Instance Method Summary collapse
- #api_base ⇒ Object
-
#create(body) ⇒ Wavefront::Response
POST /api/v2/extlink Create a specific external link.
-
#delete(id) ⇒ Wavefront::Response
DELETE /api/v2/extlink/id Delete a specific external link.
-
#describe(id) ⇒ Wavefront::Response
GET /api/v2/extlink/id Get a specific external link.
-
#list(offset = 0, limit = 100) ⇒ Object
GET /api/v2/extlink Get all external links for a customer.
-
#update(id, body, modify = true) ⇒ Wavefront::Response
PUT /api/v2/extlink/id Update a specific external link.
- #update_keys ⇒ Object
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
#api_base ⇒ Object
8 9 10 |
# File 'lib/wavefront-sdk/externallink.rb', line 8 def api_base '/extlink' end |
#create(body) ⇒ Wavefront::Response
POST /api/v2/extlink Create a specific external link.
32 33 34 35 |
# File 'lib/wavefront-sdk/externallink.rb', line 32 def create(body) raise ArgumentError unless body.is_a?(Hash) api_post('', body, 'application/json') end |
#delete(id) ⇒ Wavefront::Response
DELETE /api/v2/extlink/id Delete a specific external link.
43 44 45 46 |
# File 'lib/wavefront-sdk/externallink.rb', line 43 def delete(id) wf_link_id?(id) api_delete(id) end |
#describe(id) ⇒ Wavefront::Response
GET /api/v2/extlink/id Get a specific external link.
54 55 56 57 |
# File 'lib/wavefront-sdk/externallink.rb', line 54 def describe(id) wf_link_id?(id) api_get(id) end |
#list(offset = 0, limit = 100) ⇒ Object
GET /api/v2/extlink Get all external links for a customer
22 23 24 |
# File 'lib/wavefront-sdk/externallink.rb', line 22 def list(offset = 0, limit = 100) api_get('', { offset: offset, limit: limit }) end |
#update(id, body, modify = true) ⇒ Wavefront::Response
PUT /api/v2/extlink/id Update a specific external link.
70 71 72 73 74 75 76 77 78 |
# File 'lib/wavefront-sdk/externallink.rb', line 70 def update(id, body, modify = true) wf_link_id?(id) raise ArgumentError unless body.is_a?(Hash) return api_put(id, body, 'application/json') unless modify api_put(id, hash_for_update(describe(id).response, body), 'application/json') end |
#update_keys ⇒ Object
12 13 14 |
# File 'lib/wavefront-sdk/externallink.rb', line 12 def update_keys i(name template description) end |