Class: Wavefront::Proxy
Overview
Manage and query Wavefront proxies.
Instance Attribute Summary
Attributes inherited from CoreApi
#api, #creds, #logger, #opts, #update_keys
Instance Method Summary collapse
-
#delete(id) ⇒ Wavefront::Response
DELETE /api/v2/proxy/id Delete a specific proxy.
-
#describe(id) ⇒ Wavefront::Response
GET /api/v2/proxy/id Get a specific proxy.
-
#list(offset = 0, limit = 100) ⇒ Object
GET /api/v2/proxy Get all proxies for a customer.
-
#rename(id, name) ⇒ Wavefront::Response
PUT /api/v2/proxy/id Update the name of a specific proxy.
-
#undelete(id) ⇒ Wavefront::Response
POST /api/v2/proxy/id/undelete Undelete a specific proxy.
-
#update(id, payload) ⇒ Wavefront::Response
A generic function to change properties of a proxy.
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
#uuid?, #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_usergroup_id?, #wf_value?, #wf_version?, #wf_webhook_id?
Constructor Details
This class inherits a constructor from Wavefront::CoreApi
Instance Method Details
#delete(id) ⇒ Wavefront::Response
DELETE /api/v2/proxy/id Delete a specific proxy
Deleting an active proxy moves it to ‘trash’, from where it can be restored with an #undelete operation. Deleting a proxy in ‘trash’ removes it for ever.
28 29 30 31 |
# File 'lib/wavefront-sdk/proxy.rb', line 28 def delete(id) wf_proxy_id?(id) api.delete(id) end |
#describe(id) ⇒ Wavefront::Response
GET /api/v2/proxy/id Get a specific proxy
39 40 41 42 |
# File 'lib/wavefront-sdk/proxy.rb', line 39 def describe(id) wf_proxy_id?(id) api.get(id) end |
#list(offset = 0, limit = 100) ⇒ Object
GET /api/v2/proxy Get all proxies for a customer
14 15 16 |
# File 'lib/wavefront-sdk/proxy.rb', line 14 def list(offset = 0, limit = 100) api.get('', offset: offset, limit: limit) end |
#rename(id, name) ⇒ Wavefront::Response
PUT /api/v2/proxy/id Update the name of a specific proxy
Rename a proxy. This changes the human-readable name, not the unique identifier.
67 68 69 70 71 |
# File 'lib/wavefront-sdk/proxy.rb', line 67 def rename(id, name) wf_proxy_id?(id) wf_string?(name) update(id, name: name) end |
#undelete(id) ⇒ Wavefront::Response
POST /api/v2/proxy/id/undelete Undelete a specific proxy
Move a proxy from ‘trash’ back into active service.
52 53 54 55 |
# File 'lib/wavefront-sdk/proxy.rb', line 52 def undelete(id) wf_proxy_id?(id) api.post([id, 'undelete'].uri_concat) end |
#update(id, payload) ⇒ Wavefront::Response
A generic function to change properties of a proxy. So far as I know, only the ‘name’ property can currently be changed, and we supply a dedicated #rename method for that.
83 84 85 86 |
# File 'lib/wavefront-sdk/proxy.rb', line 83 def update(id, payload) wf_proxy_id?(id) api.put(id, payload) end |