Class: Wavefront::MaintenanceWindow
- Defined in:
- lib/wavefront-sdk/maintenancewindow.rb
Overview
Manage and query Wavefront maintenance windows
Instance Attribute Summary
Attributes inherited from Base
#api_base, #conn, #debug, #logger, #net, #noop, #opts, #update_keys, #verbose
Instance Method Summary collapse
-
#create(body) ⇒ Hash
POST /api/v2/maintenancewindow Create a maintenance window.
-
#delete(id) ⇒ Hash
DELETE /api/v2/maintenancewindow/id Delete a specific maintenance window.
-
#describe(id) ⇒ Hash
GET /api/v2/maintenancewindow/id Get a specific maintenance window.
-
#list(offset = 0, limit = 100) ⇒ Object
GET /api/v2/maintenancewindow Get all maintenance windows for a customer.
-
#update(id, body) ⇒ Hash
PUT /api/v2/maintenancewindow/id Update a specific maintenance window.
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
#create(body) ⇒ Hash
POST /api/v2/maintenancewindow Create a maintenance window.
We used to validate input here but do not any more.
29 30 31 32 |
# File 'lib/wavefront-sdk/maintenancewindow.rb', line 29 def create(body) raise ArgumentError unless body.is_a?(Hash) api_post('', body, 'application/json') end |
#delete(id) ⇒ Hash
DELETE /api/v2/maintenancewindow/id Delete a specific maintenance window.
40 41 42 43 |
# File 'lib/wavefront-sdk/maintenancewindow.rb', line 40 def delete(id) wf_maintenance_window_id?(id) api_delete(id) end |
#describe(id) ⇒ Hash
GET /api/v2/maintenancewindow/id Get a specific maintenance window.
51 52 53 54 |
# File 'lib/wavefront-sdk/maintenancewindow.rb', line 51 def describe(id) wf_maintenance_window_id?(id) api_get(id) end |
#list(offset = 0, limit = 100) ⇒ Object
GET /api/v2/maintenancewindow Get all maintenance windows for a customer.
15 16 17 |
# File 'lib/wavefront-sdk/maintenancewindow.rb', line 15 def list(offset = 0, limit = 100) api_get('', { offset: offset, limit: limit }) end |
#update(id, body) ⇒ Hash
PUT /api/v2/maintenancewindow/id Update a specific maintenance window.
63 64 65 66 67 |
# File 'lib/wavefront-sdk/maintenancewindow.rb', line 63 def update(id, body) wf_maintenance_window_id?(id) raise ArgumentError unless body.is_a?(Hash) api_put(id, body) end |