wavefront-sdk 7.0.0 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +3 -3
  3. data/.github/workflows/test.yml +1 -1
  4. data/.rubocop.yml +1 -1
  5. data/Gemfile +11 -0
  6. data/HISTORY.md +31 -4
  7. data/README.md +3 -3
  8. data/lib/wavefront-sdk/accesspolicy.rb +37 -0
  9. data/lib/wavefront-sdk/account.rb +28 -0
  10. data/lib/wavefront-sdk/alert.rb +29 -10
  11. data/lib/wavefront-sdk/api_mixins/tag.rb +12 -12
  12. data/lib/wavefront-sdk/apitoken.rb +29 -2
  13. data/lib/wavefront-sdk/cloudintegration.rb +10 -8
  14. data/lib/wavefront-sdk/cluster.rb +18 -0
  15. data/lib/wavefront-sdk/core/api_caller.rb +2 -2
  16. data/lib/wavefront-sdk/core/exception.rb +4 -0
  17. data/lib/wavefront-sdk/dashboard.rb +7 -6
  18. data/lib/wavefront-sdk/defs/version.rb +1 -1
  19. data/lib/wavefront-sdk/derivedmetric.rb +7 -6
  20. data/lib/wavefront-sdk/event.rb +5 -5
  21. data/lib/wavefront-sdk/externallink.rb +3 -3
  22. data/lib/wavefront-sdk/ingestionpolicy.rb +32 -5
  23. data/lib/wavefront-sdk/integration.rb +14 -4
  24. data/lib/wavefront-sdk/internals.rb +93 -0
  25. data/lib/wavefront-sdk/maintenancewindow.rb +3 -3
  26. data/lib/wavefront-sdk/message.rb +1 -1
  27. data/lib/wavefront-sdk/metricspolicy.rb +1 -1
  28. data/lib/wavefront-sdk/monitoredapplication.rb +55 -0
  29. data/lib/wavefront-sdk/notificant.rb +4 -4
  30. data/lib/wavefront-sdk/proxy.rb +26 -4
  31. data/lib/wavefront-sdk/role.rb +2 -2
  32. data/lib/wavefront-sdk/savedsearch.rb +4 -4
  33. data/lib/wavefront-sdk/search.rb +6 -4
  34. data/lib/wavefront-sdk/source.rb +6 -6
  35. data/lib/wavefront-sdk/spansamplingpolicy.rb +126 -0
  36. data/lib/wavefront-sdk/stdlib/string.rb +1 -1
  37. data/lib/wavefront-sdk/support/parse_time.rb +1 -1
  38. data/lib/wavefront-sdk/user.rb +5 -5
  39. data/lib/wavefront-sdk/usergroup.rb +2 -2
  40. data/lib/wavefront-sdk/validators.rb +28 -5
  41. data/lib/wavefront-sdk/webhook.rb +3 -3
  42. data/lib/wavefront-sdk/write.rb +1 -0
  43. data/lib/wavefront-sdk/writers/api.rb +31 -8
  44. data/lib/wavefront-sdk/writers/http.rb +2 -0
  45. data/spec/spec_helper.rb +1 -1
  46. data/spec/wavefront-sdk/accesspolicy_spec.rb +53 -0
  47. data/spec/wavefront-sdk/account_spec.rb +32 -1
  48. data/spec/wavefront-sdk/alert_spec.rb +17 -0
  49. data/spec/wavefront-sdk/api_mixins/user_mixins_spec.rb +1 -1
  50. data/spec/wavefront-sdk/apitoken_spec.rb +12 -0
  51. data/spec/wavefront-sdk/cluster_spec.rb +13 -0
  52. data/spec/wavefront-sdk/core/api_caller_spec.rb +1 -1
  53. data/spec/wavefront-sdk/core/api_spec.rb +1 -1
  54. data/spec/wavefront-sdk/core/logger_spec.rb +1 -1
  55. data/spec/wavefront-sdk/core/response_spec.rb +1 -1
  56. data/spec/wavefront-sdk/credentials_spec.rb +2 -2
  57. data/spec/wavefront-sdk/distribution_spec.rb +1 -1
  58. data/spec/wavefront-sdk/ingestionpolicy_spec.rb +11 -0
  59. data/spec/wavefront-sdk/integration_spec.rb +4 -0
  60. data/spec/wavefront-sdk/internals_spec.rb +62 -0
  61. data/spec/wavefront-sdk/metric_helper_spec.rb +1 -1
  62. data/spec/wavefront-sdk/misc_spec.rb +1 -1
  63. data/spec/wavefront-sdk/monitoredapplication_spec.rb +35 -0
  64. data/spec/wavefront-sdk/paginator/base_spec.rb +1 -1
  65. data/spec/wavefront-sdk/paginator/post_spec.rb +1 -1
  66. data/spec/wavefront-sdk/proxy_spec.rb +14 -0
  67. data/spec/wavefront-sdk/resources/swagger.spec.gz +0 -0
  68. data/spec/wavefront-sdk/spansamplingpolicy_spec.rb +47 -0
  69. data/spec/wavefront-sdk/spy_spec.rb +1 -1
  70. data/spec/wavefront-sdk/stdlib/array_spec.rb +1 -1
  71. data/spec/wavefront-sdk/stdlib/hash_spec.rb +1 -1
  72. data/spec/wavefront-sdk/stdlib/string_spec.rb +1 -1
  73. data/spec/wavefront-sdk/support/mixins_spec.rb +1 -1
  74. data/spec/wavefront-sdk/support/parse_time_spec.rb +1 -1
  75. data/spec/wavefront-sdk/unstable/chart_spec.rb +1 -1
  76. data/spec/wavefront-sdk/usage_spec.rb +0 -1
  77. data/spec/wavefront-sdk/validators_spec.rb +17 -1
  78. data/spec/wavefront-sdk/write_spec.rb +1 -1
  79. data/spec/wavefront-sdk/writers/api_spec.rb +1 -1
  80. data/spec/wavefront-sdk/writers/core_spec.rb +1 -1
  81. data/spec/wavefront-sdk/writers/http_spec.rb +1 -1
  82. data/spec/wavefront-sdk/writers/proxy_spec.rb +1 -1
  83. data/spec/wavefront-sdk/writers/socket_spec.rb +1 -1
  84. data/spec/wavefront-sdk/writers/summary_spec.rb +1 -1
  85. data/wavefront-sdk.gemspec +2 -13
  86. metadata +17 -146
@@ -56,10 +56,10 @@ module Wavefront
56
56
  api.post('', body, 'application/json')
57
57
  end
58
58
 
59
- # DELETE /api/v2/event/id
59
+ # DELETE /api/v2/event/{id}
60
60
  # Delete a specific event.
61
61
  #
62
- # @param id [String] ID of the alert
62
+ # @param id [String] ID of the event
63
63
  # @return [Wavefront::Response]
64
64
  #
65
65
  def delete(id)
@@ -67,7 +67,7 @@ module Wavefront
67
67
  api.delete(id)
68
68
  end
69
69
 
70
- # GET /api/v2/event/id
70
+ # GET /api/v2/event/{id}
71
71
  # Get a specific event / Get a specific historical version of a
72
72
  # specific event.
73
73
  #
@@ -83,7 +83,7 @@ module Wavefront
83
83
  api.get(fragments.uri_concat)
84
84
  end
85
85
 
86
- # PUT /api/v2/event/id
86
+ # PUT /api/v2/event/{id}
87
87
  # Update a specific event
88
88
  #
89
89
  # This method helps you update one or more properties of an event.
@@ -107,7 +107,7 @@ module Wavefront
107
107
  'application/json')
108
108
  end
109
109
 
110
- # POST /api/v2/event/id/close
110
+ # POST /api/v2/event/{id}/close
111
111
  # Close a specific event.
112
112
  #
113
113
  # @param id [String] the ID of the event
@@ -38,7 +38,7 @@ module Wavefront
38
38
  api.post('', body, 'application/json')
39
39
  end
40
40
 
41
- # DELETE /api/v2/extlink/id
41
+ # DELETE /api/v2/extlink/{id}
42
42
  # Delete a specific external link.
43
43
  #
44
44
  # @param id [String] ID of the link
@@ -49,7 +49,7 @@ module Wavefront
49
49
  api.delete(id)
50
50
  end
51
51
 
52
- # GET /api/v2/extlink/id
52
+ # GET /api/v2/extlink/{id}
53
53
  # Get a specific external link.
54
54
  #
55
55
  # @param id [String] ID of the limnk
@@ -60,7 +60,7 @@ module Wavefront
60
60
  api.get(id)
61
61
  end
62
62
 
63
- # PUT /api/v2/extlink/id
63
+ # PUT /api/v2/extlink/{id}
64
64
  # Update a specific external link.
65
65
  #
66
66
  # @param id [String] a Wavefront external link ID
@@ -41,7 +41,7 @@ module Wavefront
41
41
  # DELETE /api/v2/usage/ingestionpolicy/{id}
42
42
  # Delete a specific ingestion policy
43
43
  #
44
- # @param id [String] ID of the alert
44
+ # @param id [String] ID of the ingestion policy
45
45
  # @return [Wavefront::Response]
46
46
  #
47
47
  def delete(id)
@@ -50,21 +50,26 @@ module Wavefront
50
50
  end
51
51
 
52
52
  # GET /api/v2/usage/ingestionpolicy/{id}
53
+ # GET /api/v2/usage/ingestionpolicy/{id}/history/{version}
53
54
  # Get a specific ingestion policy
54
55
  #
55
56
  # @return [Wavefront::Response]
56
- # @param id [String] ID of the proxy
57
+ # @param id [String] ID of the ingestion policy
58
+ # @param version [Integer] version of ingestion policy
57
59
  # @return [Wavefront::Response]
58
60
  #
59
- def describe(id)
61
+ def describe(id, version = nil)
60
62
  wf_ingestionpolicy_id?(id)
61
- api.get(id)
63
+ wf_version?(version) if version
64
+ fragments = [id]
65
+ fragments += ['history', version] if version
66
+ api.get(fragments.uri_concat)
62
67
  end
63
68
 
64
69
  # PUT /api/v2/usage/ingestionpolicy/{id}
65
70
  # Update a specific ingestion policy
66
71
  #
67
- # @param id [String] a Wavefront alert ID
72
+ # @param id [String] ID of the ingestion policy
68
73
  # @param body [Hash] key-value hash of the parameters you wish
69
74
  # to change
70
75
  # @param modify [true, false] if true, use {#describe()} to get
@@ -82,6 +87,28 @@ module Wavefront
82
87
  'application/json')
83
88
  end
84
89
 
90
+ # GET /api/v2/usage/ingestionpolicy/{id}/history
91
+ # Get the version history of ingestion policy
92
+ # @param id [String] ID of the ingestion policy
93
+ # @return [Wavefront::Response]
94
+ #
95
+ def history(id)
96
+ wf_ingestionpolicy_id?(id)
97
+ api.get([id, 'history'].uri_concat)
98
+ end
99
+
100
+ # POST /api/v2/usage/ingestionpolicy/{id}/revert/{version}
101
+ # Revert to a specific historical version of a ingestion policy
102
+ # @param id [String] ID of the ingestion policy
103
+ # @param version [Integer] version to revert to
104
+ # @return [Wavefront::Response]
105
+ #
106
+ def revert(id, version)
107
+ wf_ingestionpolicy_id?(id)
108
+ wf_version?(version)
109
+ api.post([id, 'revert', version].uri_concat, nil, 'application/json')
110
+ end
111
+
85
112
  def update_keys
86
113
  %i[name]
87
114
  end
@@ -19,7 +19,7 @@ module Wavefront
19
19
  api.get('', offset: offset, limit: limit)
20
20
  end
21
21
 
22
- # GET /api/v2/integration/id
22
+ # GET /api/v2/integration/{id}
23
23
  # Gets a single Wavefront integration by its id, along with its
24
24
  # status
25
25
  #
@@ -31,7 +31,7 @@ module Wavefront
31
31
  api.get(id)
32
32
  end
33
33
 
34
- # POST /api/v2/integration/id/install
34
+ # POST /api/v2/integration/{id}/install
35
35
  # Installs a Wavefront integration
36
36
  #
37
37
  # @param id [String] ID of the integration
@@ -53,7 +53,7 @@ module Wavefront
53
53
  api.post([id, 'install-all-alerts'].uri_concat, nil)
54
54
  end
55
55
 
56
- # GET /api/v2/integration/id/status
56
+ # GET /api/v2/integration/{id}/status
57
57
  # Gets the status of a single Wavefront integration
58
58
  #
59
59
  # @param id [String] ID of the integration
@@ -64,7 +64,7 @@ module Wavefront
64
64
  api.get([id, 'status'].uri_concat)
65
65
  end
66
66
 
67
- # POST /api/v2/integration/id/uninstall
67
+ # POST /api/v2/integration/{id}/uninstall
68
68
  # Uninstalls a Wavefront integration
69
69
  #
70
70
  # @param id [String] ID of the integration
@@ -114,5 +114,15 @@ module Wavefront
114
114
  def statuses
115
115
  api.get('status')
116
116
  end
117
+
118
+ # GET /api/v2/integration/manifests/min
119
+ # Gets all Wavefront integrations as structured in their integration
120
+ # manifests.
121
+ #
122
+ # @return [Wavefront::Response]
123
+ #
124
+ def manifests_min
125
+ api.get('manifests/min')
126
+ end
117
127
  end
118
128
  end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'faraday'
4
+ require 'pathname'
5
+
6
+ module Wavefront
7
+ #
8
+ # Methods to inspect the SDK itselr.
9
+ #
10
+ class Internals
11
+ API_REGEX = %r{^\s+ # (GET|POST|PUT|DELETE|PATCH) /}
12
+
13
+ # @return [Array[Pathname]] SDK API files
14
+ #
15
+ def sdk_files
16
+ Pathname.glob("#{__dir__}/**/*")
17
+ .select { |f| f.file? && f.extname == '.rb' }
18
+ .reject { |f| f == Pathname.new(__FILE__) }
19
+ end
20
+
21
+ # @return [Array[String]] list of all the remote API paths the SDK covers.
22
+ # Depends on the code being commented correctly, so not 100% bulletproof.
23
+ #
24
+ # rubocop:disable Metrics/AbcSize
25
+ def supported_api_paths
26
+ mix = { acl: [], tag: [], user: [] }
27
+ searches = []
28
+
29
+ paths = sdk_files.map do |f|
30
+ lines = File.readlines(f)
31
+ searches << f if lines.grep('CoreApi')
32
+ mix.each_key { |m| mix[m] << f if lines.grep(%r{"api_mixins/#{m}"}) }
33
+ lines.grep(API_REGEX)
34
+ end
35
+
36
+ clean = paths_struct(clean_paths(paths))
37
+ clean + mixin_paths(clean, mix) + search_paths(clean, searches)
38
+ end
39
+ # rubocop:enable Metrics/AbcSize
40
+
41
+ def clean_paths(paths)
42
+ paths.flatten.compact.map { |s| s.strip.sub(/^# /, '') }
43
+ end
44
+
45
+ def search_paths(paths, files)
46
+ search_paths = paths.select { |_v, x| x.include?('/search/') }
47
+
48
+ search_paths.each_with_object([]) do |(verb, path), ret|
49
+ files.each { |f| ret << [verb, path.sub('{entity}', api_word(f))] }
50
+ end
51
+ end
52
+
53
+ def remote_api_paths(spec = swagger_spec)
54
+ paths = JSON.parse(spec)['paths'].map do |path, data|
55
+ data.keys.map { |verb| [verb.upcase, path].join(' ') }
56
+ end
57
+
58
+ paths_struct(paths.flatten)
59
+ end
60
+
61
+ def missing_api_paths
62
+ # We don't have an explicit method for the many search paths: they're
63
+ # all bundled together under a generic Wavefront::Search.
64
+ (remote_api_paths - supported_api_paths).reject do |_method, path|
65
+ path.start_with?('/api/v2/search/')
66
+ end
67
+ end
68
+
69
+ private
70
+
71
+ def mixin_paths(paths, mixins)
72
+ mixins.each_with_object([]) do |(mixin, files), ret|
73
+ files.each do |file|
74
+ paths.select { |_v, x| x.include?(mixin.to_s) }.each do |verb, path|
75
+ ret << [verb, path.sub('{entity}', api_word(file))]
76
+ end
77
+ end
78
+ end
79
+ end
80
+
81
+ def api_word(file)
82
+ file.basename.to_s.sub(/\.rb$/, '')
83
+ end
84
+
85
+ def swagger_spec
86
+ Faraday.get('https://metrics.wavefront.com/api/v2/swagger.json').body
87
+ end
88
+
89
+ def paths_struct(paths)
90
+ paths.map(&:split).sort_by { |_k, v| v }
91
+ end
92
+ end
93
+ end
@@ -38,7 +38,7 @@ module Wavefront
38
38
  api.post('', body, 'application/json')
39
39
  end
40
40
 
41
- # DELETE /api/v2/maintenancewindow/id
41
+ # DELETE /api/v2/maintenancewindow/{id}
42
42
  # Delete a specific maintenance window.
43
43
  #
44
44
  # @param id [String, Integer] ID of the maintenance window
@@ -49,7 +49,7 @@ module Wavefront
49
49
  api.delete(id)
50
50
  end
51
51
 
52
- # GET /api/v2/maintenancewindow/id
52
+ # GET /api/v2/maintenancewindow/{id}
53
53
  # Get a specific maintenance window.
54
54
  #
55
55
  # @param id [String, Integer] ID of the maintenance window
@@ -60,7 +60,7 @@ module Wavefront
60
60
  api.get(id)
61
61
  end
62
62
 
63
- # PUT /api/v2/maintenancewindow/id
63
+ # PUT /api/v2/maintenancewindow/{id}
64
64
  # Update a specific maintenance window.
65
65
  #
66
66
  # @param id [String] a Wavefront maintenance window ID
@@ -18,7 +18,7 @@ module Wavefront
18
18
  api.get('', offset: offset, limit: limit, unreadOnly: unread_only)
19
19
  end
20
20
 
21
- # POST /api/v2/message/id/read
21
+ # POST /api/v2/message/{id}/read
22
22
  # Mark a specific message as read
23
23
  #
24
24
  # @param id [String] message ID to mark as read
@@ -35,7 +35,7 @@ module Wavefront
35
35
 
36
36
  # POST /api/v2/metricspolicy/revert/{version}
37
37
  # Revert to a specific historical version of a metrics policy
38
- # @param version [Integer] specify version to describe
38
+ # @param version [Integer] version to revert to
39
39
  # @return [Wavefront::Response]
40
40
  #
41
41
  def revert(version)
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'core/api'
4
+
5
+ module Wavefront
6
+ #
7
+ # Manage and query Wavefront monitored applications
8
+ #
9
+ class MonitoredApplication < CoreApi
10
+ def update_keys
11
+ %i[hidden application satisfiedLatencyMillis]
12
+ end
13
+
14
+ # GET /api/v2/monitoredapplication
15
+ # Get all monitored services
16
+ #
17
+ # @param offset [Integer] application at which the list begins
18
+ # @param limit [Integer] the number of application to return
19
+ #
20
+ def list(offset = 0, limit = 100)
21
+ api.get('', offset: offset, limit: limit)
22
+ end
23
+
24
+ # GET /api/v2/monitoredapplication/{application}
25
+ # Get a specific application
26
+ #
27
+ # @param id [String, Integer] ID of the application
28
+ # @return [Wavefront::Response]
29
+ #
30
+ def describe(id)
31
+ wf_monitoredapplication_id?(id)
32
+ api.get(id)
33
+ end
34
+
35
+ # PUT /api/v2/monitoredapplication/{application}
36
+ # Update a specific service
37
+ #
38
+ # @param id [String] a Wavefront monitored application ID
39
+ # @param body [Hash] key-value hash of the parameters you wish to change
40
+ # @param modify [true, false] if true, use {#describe()} to get a hash
41
+ # describing the existing object, and modify that with the new body. If
42
+ # false, pass the new body straight through.
43
+ # @return [Wavefront::Response]
44
+
45
+ def update(id, body, modify = true)
46
+ wf_monitoredapplication_id?(id)
47
+ raise ArgumentError unless body.is_a?(Hash)
48
+
49
+ return api.put(id, body, 'application/json') unless modify
50
+
51
+ api.put(id, hash_for_update(describe(id).response, body),
52
+ 'application/json')
53
+ end
54
+ end
55
+ end
@@ -29,7 +29,7 @@ module Wavefront
29
29
  api.post('', body, 'application/json')
30
30
  end
31
31
 
32
- # DELETE /api/v2/notificant/id
32
+ # DELETE /api/v2/notificant/{id}
33
33
  # Delete a specific notificant
34
34
  #
35
35
  # @param id [String] ID of the notification target
@@ -40,7 +40,7 @@ module Wavefront
40
40
  api.delete(id)
41
41
  end
42
42
 
43
- # GET /api/v2/notificant/id
43
+ # GET /api/v2/notificant/{id}
44
44
  # Get a specific notification target
45
45
  #
46
46
  # @param id [String] ID of the notification target
@@ -51,7 +51,7 @@ module Wavefront
51
51
  api.get(id)
52
52
  end
53
53
 
54
- # PUT /api/v2/notificant/id
54
+ # PUT /api/v2/notificant/{id}
55
55
  # Update a specific notification target
56
56
  #
57
57
  # @param id [String] a Wavefront notification target ID
@@ -72,7 +72,7 @@ module Wavefront
72
72
  'application/json')
73
73
  end
74
74
 
75
- # POST /api/v2/notificant/test/id
75
+ # POST /api/v2/notificant/test/{id}
76
76
  # Create a notification target.
77
77
  #
78
78
  # @param body [Hash] description of notification target
@@ -17,7 +17,7 @@ module Wavefront
17
17
  api.get('', offset: offset, limit: limit)
18
18
  end
19
19
 
20
- # DELETE /api/v2/proxy/id
20
+ # DELETE /api/v2/proxy/{id}
21
21
  # Delete a specific proxy
22
22
  #
23
23
  # Deleting an active proxy moves it to 'trash', from where it
@@ -32,7 +32,7 @@ module Wavefront
32
32
  api.delete(id)
33
33
  end
34
34
 
35
- # GET /api/v2/proxy/id
35
+ # GET /api/v2/proxy/{id}
36
36
  # Get a specific proxy
37
37
  #
38
38
  # @param id [String] ID of the proxy
@@ -43,7 +43,7 @@ module Wavefront
43
43
  api.get(id)
44
44
  end
45
45
 
46
- # POST /api/v2/proxy/id/undelete
46
+ # POST /api/v2/proxy/{id}/undelete
47
47
  # Undelete a specific proxy
48
48
  #
49
49
  # Move a proxy from 'trash' back into active service.
@@ -56,7 +56,7 @@ module Wavefront
56
56
  api.post([id, 'undelete'].uri_concat)
57
57
  end
58
58
 
59
- # PUT /api/v2/proxy/id
59
+ # PUT /api/v2/proxy/{id}
60
60
  # Update the name of a specific proxy
61
61
  #
62
62
  # Rename a proxy. This changes the human-readable name, not the
@@ -96,5 +96,27 @@ module Wavefront
96
96
  wf_proxy_id?(id)
97
97
  api.put(id, { shutdown: true }, 'application/json')
98
98
  end
99
+
100
+ # GET /api/v2/proxy/{id}/config
101
+ # Get a specific proxy config
102
+ #
103
+ # @param id [String] ID of the proxy
104
+ # @return [Wavefront::Response]
105
+ #
106
+ def config(id)
107
+ wf_proxy_id?(id)
108
+ api.get([id, 'config'].uri_concat)
109
+ end
110
+
111
+ # GET /api/v2/proxy/{id}/preprocessorRules
112
+ # Get a specific proxy preprocessor rules
113
+ #
114
+ # @param id [String] ID of the proxy
115
+ # @return [Wavefront::Response]
116
+ #
117
+ def preprocessor_rules(id)
118
+ wf_proxy_id?(id)
119
+ api.get([id, 'preprocessorRules'].uri_concat)
120
+ end
99
121
  end
100
122
  end
@@ -16,8 +16,8 @@ module Wavefront
16
16
 
17
17
  # GET /api/v2/role
18
18
  # Get all roles for a customer
19
- # @param offset [Int] alert at which the list begins
20
- # @param limit [Int] the number of alerts to return
19
+ # @param offset [Int] item at which the list begins
20
+ # @param limit [Int] the number of items to return
21
21
  # @return [Wavefront::Response]
22
22
  #
23
23
  def list(offset = 0, limit = 100)
@@ -32,7 +32,7 @@ module Wavefront
32
32
  api.post('', body, 'application/json')
33
33
  end
34
34
 
35
- # DELETE /api/v2/savedsearch/id
35
+ # DELETE /api/v2/savedsearch/{id}
36
36
  # Delete a specific saved search.
37
37
  #
38
38
  # @param id [String] ID of the saved search
@@ -43,7 +43,7 @@ module Wavefront
43
43
  api.delete(id)
44
44
  end
45
45
 
46
- # GET /api/v2/savedsearch/id
46
+ # GET /api/v2/savedsearch/{id}
47
47
  # Get a specific saved search.
48
48
  #
49
49
  # @param id [String] ID of the saved search
@@ -54,7 +54,7 @@ module Wavefront
54
54
  api.get(id)
55
55
  end
56
56
 
57
- # PUT /api/v2/savedsearch/id
57
+ # PUT /api/v2/savedsearch/{id}
58
58
  # Update a specific saved search.
59
59
  #
60
60
  # @param id [String] ID of the saved search
@@ -67,7 +67,7 @@ module Wavefront
67
67
  api.put(id, body)
68
68
  end
69
69
 
70
- # GET /api/v2/savedsearch/type/entitytype
70
+ # GET /api/v2/savedsearch/type/{entitytype}
71
71
  # Get all saved searches for a specific entity type for a user.
72
72
  #
73
73
  # @param entitytype [String] type of entity to retrieve
@@ -10,8 +10,8 @@ module Wavefront
10
10
  # lot up to the user. It may grow, with convenience methods.
11
11
  #
12
12
  class Search < CoreApi
13
- # POST /api/v2/search/entity
14
- # POST /api/v2/search/entity/deleted
13
+ # POST /api/v2/search/{entity}
14
+ # POST /api/v2/search/{entity}/deleted
15
15
  # Run a search query. This single method maps to many API paths.
16
16
  # It is a wrapper around #raw_search() for common, single
17
17
  # key-value searches. If you need to do more complicated things,
@@ -78,8 +78,8 @@ module Wavefront
78
78
  ascending: !options[:desc] || true }
79
79
  end
80
80
 
81
- # POST /api/v2/search/entity
82
- # POST /api/v2/search/entity/deleted
81
+ # POST /api/v2/search/{entity}
82
+ # POST /api/v2/search/{entity}/deleted
83
83
  # Run a search query. This single method maps to many API paths.
84
84
  #
85
85
  # @param entity [String] the type of Wavefront object you wish
@@ -102,6 +102,8 @@ module Wavefront
102
102
  api.post(path, body, 'application/json')
103
103
  end
104
104
 
105
+ # POST /api/v2/search/{entity}/facets
106
+ # POST /api/v2/search/{entity}/{facet}
105
107
  # @param entity [String] the type of Wavefront object you wish
106
108
  # to search
107
109
  # @param body [Hash] the query to use for searching. Refer to
@@ -43,7 +43,7 @@ module Wavefront
43
43
  api.post('', body, 'application/json')
44
44
  end
45
45
 
46
- # DELETE /api/v2/source/id
46
+ # DELETE /api/v2/source/{id}
47
47
  # Delete metadata (description and tags) for a specific source.
48
48
  #
49
49
  # @param id [String] ID of the source
@@ -54,7 +54,7 @@ module Wavefront
54
54
  api.delete(id)
55
55
  end
56
56
 
57
- # POST /api/v2/source/id/description
57
+ # POST /api/v2/source/{id}/description
58
58
  # Set description associated with a specific source
59
59
 
60
60
  def description_set(id, description)
@@ -63,7 +63,7 @@ module Wavefront
63
63
  'application/json')
64
64
  end
65
65
 
66
- # DELETE /api/v2/source/id/description
66
+ # DELETE /api/v2/source/{id}/description
67
67
  # Remove description from a specific source
68
68
 
69
69
  def description_delete(id)
@@ -71,7 +71,7 @@ module Wavefront
71
71
  api.delete([id, 'description'].uri_concat)
72
72
  end
73
73
 
74
- # GET /api/v2/source/id
74
+ # GET /api/v2/source/{id}
75
75
  # Get a specific source for a customer.
76
76
  #
77
77
  # @param id [String] ID of the source
@@ -85,10 +85,10 @@ module Wavefront
85
85
  api.get(fragments.uri_concat)
86
86
  end
87
87
 
88
- # PUT /api/v2/source/id
88
+ # PUT /api/v2/source/{id}
89
89
  # Update metadata (description or tags) for a specific source.
90
90
  #
91
- # @param id [String] a Wavefront alert ID
91
+ # @param id [String] a Wavefront source ID
92
92
  # @param body [Hash] key-value hash of the parameters you wish
93
93
  # to change
94
94
  # @param modify [true, false] if true, use {#describe()} to get