Class: Wavefront::Integration

Inherits:
CoreApi
  • Object
show all
Defined in:
lib/wavefront-sdk/integration.rb

Overview

Manage and query Wavefront integrations.

Instance Attribute Summary

Attributes inherited from CoreApi

#api, #creds, #logger, #opts, #update_keys

Instance Method Summary collapse

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_account_id?, #wf_alert_id?, #wf_alert_severity?, #wf_apitoken_id?, #wf_aws_external_id?, #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_ingestionpolicy_id?, #wf_integration_id?, #wf_link_id?, #wf_link_template?, #wf_maintenance_window_id?, #wf_message_id?, #wf_metric_name?, #wf_metricspolicy_id?, #wf_monitoredapplication_id?, #wf_monitoredcluster_id?, #wf_ms_ts?, #wf_name?, #wf_notificant_id?, #wf_permission?, #wf_point?, #wf_point_tag?, #wf_point_tags?, #wf_proxy_id?, #wf_role_id?, #wf_sampling_value?, #wf_savedsearch_entity?, #wf_savedsearch_id?, #wf_serviceaccount_id?, #wf_source_id?, #wf_spansamplingpolicy_id?, #wf_string?, #wf_tag?, #wf_trace?, #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

#describe(id) ⇒ Wavefront::Response

GET /api/v2/integration/id Gets a single Wavefront integration by its id, along with its status

Parameters:

  • id (String)

    ID of the proxy

Returns:



29
30
31
32
# File 'lib/wavefront-sdk/integration.rb', line 29

def describe(id)
  wf_integration_id?(id)
  api.get(id)
end

#install(id) ⇒ Wavefront::Response

POST /api/v2/integration/id/install Installs a Wavefront integration

Parameters:

  • id (String)

    ID of the integration

Returns:



40
41
42
43
# File 'lib/wavefront-sdk/integration.rb', line 40

def install(id)
  wf_integration_id?(id)
  api.post([id, 'install'].uri_concat, nil)
end

#install_all_alerts(id) ⇒ Wavefront::Response

POST /api/v2/integration/id/install-all-alerts Enable all alerts associated with this integration

Parameters:

  • id (String)

    ID of the integration

Returns:



51
52
53
54
# File 'lib/wavefront-sdk/integration.rb', line 51

def install_all_alerts(id)
  wf_integration_id?(id)
  api.post([id, 'install-all-alerts'].uri_concat, nil)
end

#installedWavefront::Response

GET /api/v2/integration/installed Gets a flat list of all Integrations that are installed, along with their status

Parameters:

  • offset (Int)

    proxy at which the list begins

  • limit (Int)

    the number of proxies to return

Returns:



97
98
99
# File 'lib/wavefront-sdk/integration.rb', line 97

def installed
  api.get('installed')
end

#list(offset = 0, limit = 100) ⇒ Wavefront::Response

GET /api/v2/integration Gets a flat list of all Wavefront integrations available, along with their status

Parameters:

  • offset (Int) (defaults to: 0)

    proxy at which the list begins

  • limit (Int) (defaults to: 100)

    the number of proxies to return

Returns:



18
19
20
# File 'lib/wavefront-sdk/integration.rb', line 18

def list(offset = 0, limit = 100)
  api.get('', offset: offset, limit: limit)
end

#manifestsObject

GET /api/v2/integration/manifests Gets all Wavefront integrations as structured in their integration manifests, along with their status



105
106
107
# File 'lib/wavefront-sdk/integration.rb', line 105

def manifests
  api.get('manifests')
end

#manifests_minWavefront::Response

GET /api/v2/integration/manifests/min Gets all Wavefront integrations as structured in their integration manifests.

Returns:



124
125
126
# File 'lib/wavefront-sdk/integration.rb', line 124

def manifests_min
  api.get('manifests/min')
end

#status(id) ⇒ Wavefront::Response

GET /api/v2/integration/id/status Gets the status of a single Wavefront integration

Parameters:

  • id (String)

    ID of the integration

Returns:



62
63
64
65
# File 'lib/wavefront-sdk/integration.rb', line 62

def status(id)
  wf_integration_id?(id)
  api.get([id, 'status'].uri_concat)
end

#statusesWavefront::Response

GET /api/v2/integration/status Gets the status of all Wavefront integrations

Returns:



114
115
116
# File 'lib/wavefront-sdk/integration.rb', line 114

def statuses
  api.get('status')
end

#uninstall(id) ⇒ Wavefront::Response

POST /api/v2/integration/id/uninstall Uninstalls a Wavefront integration

Parameters:

  • id (String)

    ID of the integration

Returns:



73
74
75
76
# File 'lib/wavefront-sdk/integration.rb', line 73

def uninstall(id)
  wf_integration_id?(id)
  api.post([id, 'uninstall'].uri_concat, nil)
end

#uninstall_all_alerts(id) ⇒ Wavefront::Response

POST /api/v2/integration/id/uninstall-all-alerts Disable all alerts associated with this integration

Parameters:

  • id (String)

    ID of the integration

Returns:



84
85
86
87
# File 'lib/wavefront-sdk/integration.rb', line 84

def uninstall_all_alerts(id)
  wf_integration_id?(id)
  api.post([id, 'uninstall-all-alerts'].uri_concat, nil)
end