wavefront-sdk 1.6.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/HISTORY.md +39 -13
  4. data/README.md +75 -28
  5. data/Rakefile +1 -1
  6. data/lib/wavefront-sdk/alert.rb +113 -17
  7. data/lib/wavefront-sdk/cloudintegration.rb +8 -8
  8. data/lib/wavefront-sdk/core/api.rb +99 -0
  9. data/lib/wavefront-sdk/core/api_caller.rb +211 -0
  10. data/lib/wavefront-sdk/{exception.rb → core/exception.rb} +11 -6
  11. data/lib/wavefront-sdk/{logger.rb → core/logger.rb} +2 -3
  12. data/lib/wavefront-sdk/{response.rb → core/response.rb} +69 -52
  13. data/lib/wavefront-sdk/credentials.rb +6 -3
  14. data/lib/wavefront-sdk/dashboard.rb +14 -14
  15. data/lib/wavefront-sdk/{constants.rb → defs/constants.rb} +1 -0
  16. data/lib/wavefront-sdk/defs/version.rb +1 -0
  17. data/lib/wavefront-sdk/derivedmetric.rb +14 -14
  18. data/lib/wavefront-sdk/distribution.rb +75 -0
  19. data/lib/wavefront-sdk/event.rb +13 -13
  20. data/lib/wavefront-sdk/externallink.rb +8 -8
  21. data/lib/wavefront-sdk/integration.rb +9 -9
  22. data/lib/wavefront-sdk/maintenancewindow.rb +54 -8
  23. data/lib/wavefront-sdk/message.rb +4 -4
  24. data/lib/wavefront-sdk/metric.rb +3 -3
  25. data/lib/wavefront-sdk/notificant.rb +9 -9
  26. data/lib/wavefront-sdk/paginator/base.rb +148 -0
  27. data/lib/wavefront-sdk/paginator/delete.rb +11 -0
  28. data/lib/wavefront-sdk/paginator/get.rb +11 -0
  29. data/lib/wavefront-sdk/paginator/post.rb +64 -0
  30. data/lib/wavefront-sdk/paginator/put.rb +11 -0
  31. data/lib/wavefront-sdk/proxy.rb +7 -7
  32. data/lib/wavefront-sdk/query.rb +4 -4
  33. data/lib/wavefront-sdk/report.rb +9 -25
  34. data/lib/wavefront-sdk/savedsearch.rb +8 -8
  35. data/lib/wavefront-sdk/search.rb +16 -13
  36. data/lib/wavefront-sdk/source.rb +14 -14
  37. data/lib/wavefront-sdk/{mixins.rb → support/mixins.rb} +8 -2
  38. data/lib/wavefront-sdk/{parse_time.rb → support/parse_time.rb} +2 -0
  39. data/lib/wavefront-sdk/types/status.rb +52 -0
  40. data/lib/wavefront-sdk/user.rb +8 -8
  41. data/lib/wavefront-sdk/validators.rb +52 -3
  42. data/lib/wavefront-sdk/webhook.rb +8 -8
  43. data/lib/wavefront-sdk/write.rb +153 -52
  44. data/lib/wavefront-sdk/writers/api.rb +38 -0
  45. data/lib/wavefront-sdk/writers/core.rb +146 -0
  46. data/lib/wavefront-sdk/writers/http.rb +42 -0
  47. data/lib/wavefront-sdk/writers/socket.rb +66 -0
  48. data/lib/wavefront-sdk/writers/summary.rb +39 -0
  49. data/lib/wavefront_sdk.rb +9 -0
  50. data/spec/spec_helper.rb +3 -0
  51. data/spec/wavefront-sdk/alert_spec.rb +6 -0
  52. data/spec/wavefront-sdk/{base_spec.rb → core/api_caller_spec.rb} +28 -41
  53. data/spec/wavefront-sdk/core/api_spec.rb +31 -0
  54. data/spec/wavefront-sdk/{logger_spec.rb → core/logger_spec.rb} +3 -3
  55. data/spec/wavefront-sdk/core/response_spec.rb +77 -0
  56. data/spec/wavefront-sdk/credentials_spec.rb +15 -10
  57. data/spec/wavefront-sdk/distribution_spec.rb +78 -0
  58. data/spec/wavefront-sdk/paginator/base_spec.rb +67 -0
  59. data/spec/wavefront-sdk/paginator/post_spec.rb +53 -0
  60. data/spec/wavefront-sdk/report_spec.rb +3 -1
  61. data/spec/wavefront-sdk/search_spec.rb +25 -0
  62. data/spec/wavefront-sdk/stdlib/array_spec.rb +2 -1
  63. data/spec/wavefront-sdk/stdlib/hash_spec.rb +6 -1
  64. data/spec/wavefront-sdk/stdlib/string_spec.rb +2 -0
  65. data/spec/wavefront-sdk/{mixins_spec.rb → support/mixins_spec.rb} +2 -2
  66. data/spec/wavefront-sdk/{parse_time_spec.rb → support/parse_time_spec.rb} +2 -2
  67. data/spec/wavefront-sdk/validators_spec.rb +64 -1
  68. data/spec/wavefront-sdk/write_spec.rb +55 -77
  69. data/spec/wavefront-sdk/writers/api_spec.rb +45 -0
  70. data/spec/wavefront-sdk/writers/core_spec.rb +49 -0
  71. data/spec/wavefront-sdk/writers/http_spec.rb +69 -0
  72. data/spec/wavefront-sdk/writers/socket_spec.rb +104 -0
  73. data/spec/wavefront-sdk/writers/summary_spec.rb +38 -0
  74. data/wavefront-sdk.gemspec +1 -1
  75. metadata +52 -24
  76. data/lib/wavefront-sdk/base.rb +0 -264
  77. data/lib/wavefront-sdk/base_write.rb +0 -185
  78. data/lib/wavefront-sdk/stdlib.rb +0 -5
  79. data/lib/wavefront-sdk/version.rb +0 -1
  80. data/spec/wavefront-sdk/base_write_spec.rb +0 -82
  81. data/spec/wavefront-sdk/response_spec.rb +0 -39
@@ -15,7 +15,7 @@ module Wavefront
15
15
  # @return [Map] information for speaking to a Wavefront proxy
16
16
  #
17
17
  class Credentials
18
- attr_reader :opts, :config, :creds, :proxy
18
+ attr_reader :opts, :config, :creds, :proxy, :all
19
19
 
20
20
  # Gives you an object of credentials and options for speaking to
21
21
  # Wavefront. It will look in the following places:
@@ -57,8 +57,11 @@ module Wavefront
57
57
  #
58
58
  def populate(raw)
59
59
  @config = Map(raw)
60
- @creds = Map(raw.select { |k, _v| %i[endpoint token].include?(k) })
61
- @proxy = Map(raw.select { |k, _v| %i[proxy port].include?(k) })
60
+ @creds = Map(raw.select { |k, _v| %i[endpoint token].include?(k) })
61
+ @proxy = Map(raw.select { |k, _v| %i[proxy port].include?(k) })
62
+ @all = Map(raw.select do |k, _v|
63
+ %i[proxy port endpoint token].include?(k)
64
+ end)
62
65
  end
63
66
 
64
67
  # @return [Array] a list of possible credential files
@@ -1,10 +1,10 @@
1
- require_relative 'base'
1
+ require_relative 'core/api'
2
2
 
3
3
  module Wavefront
4
4
  #
5
5
  # View and manage dashboards.
6
6
  #
7
- class Dashboard < Base
7
+ class Dashboard < CoreApi
8
8
  def update_keys
9
9
  %i[id name url description sections]
10
10
  end
@@ -17,7 +17,7 @@ module Wavefront
17
17
  # @return [Wavefront::Response]
18
18
  #
19
19
  def list(offset = 0, limit = 100)
20
- api_get('', offset: offset, limit: limit)
20
+ api.get('', offset: offset, limit: limit)
21
21
  end
22
22
 
23
23
  # POST /api/v2/dashboard
@@ -29,7 +29,7 @@ module Wavefront
29
29
  #
30
30
  def create(body)
31
31
  raise ArgumentError unless body.is_a?(Hash)
32
- api_post('', body, 'application/json')
32
+ api.post('', body, 'application/json')
33
33
  end
34
34
 
35
35
  # DELETE /api/v2/dashboard/id
@@ -43,7 +43,7 @@ module Wavefront
43
43
  #
44
44
  def delete(id)
45
45
  wf_dashboard_id?(id)
46
- api_delete(id)
46
+ api.delete(id)
47
47
  end
48
48
 
49
49
  # GET /api/v2/dashboard/id
@@ -59,7 +59,7 @@ module Wavefront
59
59
  wf_version?(version) if version
60
60
  fragments = [id]
61
61
  fragments += ['history', version] if version
62
- api_get(fragments.uri_concat)
62
+ api.get(fragments.uri_concat)
63
63
  end
64
64
 
65
65
  # PUT /api/v2/dashboard/id
@@ -77,9 +77,9 @@ module Wavefront
77
77
  wf_dashboard_id?(id)
78
78
  raise ArgumentError unless body.is_a?(Hash)
79
79
 
80
- return api_put(id, body, 'application/json') unless modify
80
+ return api.put(id, body, 'application/json') unless modify
81
81
 
82
- api_put(id, hash_for_update(describe(id).response, body),
82
+ api.put(id, hash_for_update(describe(id).response, body),
83
83
  'application/json')
84
84
  end
85
85
 
@@ -91,7 +91,7 @@ module Wavefront
91
91
  #
92
92
  def history(id)
93
93
  wf_dashboard_id?(id)
94
- api_get([id, 'history'].uri_concat)
94
+ api.get([id, 'history'].uri_concat)
95
95
  end
96
96
 
97
97
  # GET /api/v2/dashboard/id/tag
@@ -102,7 +102,7 @@ module Wavefront
102
102
  #
103
103
  def tags(id)
104
104
  wf_dashboard_id?(id)
105
- api_get([id, 'tag'].uri_concat)
105
+ api.get([id, 'tag'].uri_concat)
106
106
  end
107
107
 
108
108
  # POST /api/v2/dashboard/id/tag
@@ -116,7 +116,7 @@ module Wavefront
116
116
  wf_dashboard_id?(id)
117
117
  tags = Array(tags)
118
118
  tags.each { |t| wf_string?(t) }
119
- api_post([id, 'tag'].uri_concat, tags.to_json, 'application/json')
119
+ api.post([id, 'tag'].uri_concat, tags.to_json, 'application/json')
120
120
  end
121
121
 
122
122
  # DELETE /api/v2/dashboard/id/tag/tagValue
@@ -129,7 +129,7 @@ module Wavefront
129
129
  def tag_delete(id, tag)
130
130
  wf_dashboard_id?(id)
131
131
  wf_string?(tag)
132
- api_delete([id, 'tag', tag].uri_concat)
132
+ api.delete([id, 'tag', tag].uri_concat)
133
133
  end
134
134
 
135
135
  # PUT /api/v2/dashboard/id/tag/tagValue
@@ -142,7 +142,7 @@ module Wavefront
142
142
  def tag_add(id, tag)
143
143
  wf_dashboard_id?(id)
144
144
  wf_string?(tag)
145
- api_put([id, 'tag', tag].uri_concat)
145
+ api.put([id, 'tag', tag].uri_concat)
146
146
  end
147
147
 
148
148
  # POST /api/v2/dashboard/id/undelete
@@ -153,7 +153,7 @@ module Wavefront
153
153
  #
154
154
  def undelete(id)
155
155
  wf_dashboard_id?(id)
156
- api_post([id, 'undelete'].uri_concat)
156
+ api.post([id, 'undelete'].uri_concat)
157
157
  end
158
158
  end
159
159
  end
@@ -1,3 +1,4 @@
1
1
  # Constants
2
2
  #
3
3
  DELTA = "\u2206".freeze # "Increment" -- alt-J on a Mac
4
+ PAGE_SIZE = 999
@@ -0,0 +1 @@
1
+ WF_SDK_VERSION = '2.0.0'.freeze
@@ -1,10 +1,10 @@
1
- require_relative 'base'
1
+ require_relative 'core/api'
2
2
 
3
3
  module Wavefront
4
4
  #
5
5
  # View and manage derived metrics
6
6
  #
7
- class DerivedMetric < Base
7
+ class DerivedMetric < CoreApi
8
8
  def update_keys
9
9
  # %i[id name url description sections]
10
10
  end
@@ -17,7 +17,7 @@ module Wavefront
17
17
  # @return [Wavefront::Response]
18
18
  #
19
19
  def list(offset = 0, limit = 100)
20
- api_get('', offset: offset, limit: limit)
20
+ api.get('', offset: offset, limit: limit)
21
21
  end
22
22
 
23
23
  # POST /api/v2/derivedmetric
@@ -29,7 +29,7 @@ module Wavefront
29
29
  #
30
30
  def create(body)
31
31
  raise ArgumentError unless body.is_a?(Hash)
32
- api_post('', body, 'application/json')
32
+ api.post('', body, 'application/json')
33
33
  end
34
34
 
35
35
  # DELETE /api/v2/derivedmetric/id
@@ -43,7 +43,7 @@ module Wavefront
43
43
  #
44
44
  def delete(id)
45
45
  wf_derivedmetric_id?(id)
46
- api_delete(id)
46
+ api.delete(id)
47
47
  end
48
48
 
49
49
  # GET /api/v2/derivedmetric/id
@@ -59,7 +59,7 @@ module Wavefront
59
59
  wf_version?(version) if version
60
60
  fragments = [id]
61
61
  fragments += ['history', version] if version
62
- api_get(fragments.uri_concat)
62
+ api.get(fragments.uri_concat)
63
63
  end
64
64
 
65
65
  # PUT /api/v2/derivedmetric/id
@@ -77,9 +77,9 @@ module Wavefront
77
77
  wf_derivedmetric_id?(id)
78
78
  raise ArgumentError unless body.is_a?(Hash)
79
79
 
80
- return api_put(id, body, 'application/json') unless modify
80
+ return api.put(id, body, 'application/json') unless modify
81
81
 
82
- api_put(id, hash_for_update(describe(id).response, body),
82
+ api.put(id, hash_for_update(describe(id).response, body),
83
83
  'application/json')
84
84
  end
85
85
 
@@ -91,7 +91,7 @@ module Wavefront
91
91
  #
92
92
  def history(id)
93
93
  wf_derivedmetric_id?(id)
94
- api_get([id, 'history'].uri_concat)
94
+ api.get([id, 'history'].uri_concat)
95
95
  end
96
96
 
97
97
  # GET /api/v2/derivedmetric/id/tag
@@ -103,7 +103,7 @@ module Wavefront
103
103
  #
104
104
  def tags(id)
105
105
  wf_derivedmetric_id?(id)
106
- api_get([id, 'tag'].uri_concat)
106
+ api.get([id, 'tag'].uri_concat)
107
107
  end
108
108
 
109
109
  # POST /api/v2/derivedmetric/id/tag
@@ -118,7 +118,7 @@ module Wavefront
118
118
  wf_derivedmetric_id?(id)
119
119
  tags = Array(tags)
120
120
  tags.each { |t| wf_string?(t) }
121
- api_post([id, 'tag'].uri_concat, tags.to_json, 'application/json')
121
+ api.post([id, 'tag'].uri_concat, tags.to_json, 'application/json')
122
122
  end
123
123
 
124
124
  # DELETE /api/v2/derivedmetric/id/tag/tagValue
@@ -131,7 +131,7 @@ module Wavefront
131
131
  def tag_delete(id, tag)
132
132
  wf_derivedmetric_id?(id)
133
133
  wf_string?(tag)
134
- api_delete([id, 'tag', tag].uri_concat)
134
+ api.delete([id, 'tag', tag].uri_concat)
135
135
  end
136
136
 
137
137
  # PUT /api/v2/derivedmetric/id/tag/tagValue
@@ -144,7 +144,7 @@ module Wavefront
144
144
  def tag_add(id, tag)
145
145
  wf_derivedmetric_id?(id)
146
146
  wf_string?(tag)
147
- api_put([id, 'tag', tag].uri_concat)
147
+ api.put([id, 'tag', tag].uri_concat)
148
148
  end
149
149
 
150
150
  # POST /api/v2/derivedmetric/id/undelete
@@ -156,7 +156,7 @@ module Wavefront
156
156
  #
157
157
  def undelete(id)
158
158
  wf_derivedmetric_id?(id)
159
- api_post([id, 'undelete'].uri_concat)
159
+ api.post([id, 'undelete'].uri_concat)
160
160
  end
161
161
  end
162
162
  end
@@ -0,0 +1,75 @@
1
+ require_relative 'write'
2
+ require_relative 'support/mixins'
3
+
4
+ module Wavefront
5
+ #
6
+ # Help a user write histogram distributions to a Wavefront proxy
7
+ #
8
+ class Distribution < Write
9
+ include Wavefront::Mixins
10
+
11
+ # Make a distribution from a lot of numbers. The returned
12
+ # distribution is an array of arrays ready for dropping into
13
+ # #write. If you need a "real" Wavefront representation of the
14
+ # distribution, use #mk_wf_distribution.
15
+ # @param args [String, Array] numbers. Can be multiple
16
+ # arguments, a whitespace-separated string, or one or more
17
+ # arrays.
18
+ # @return [Array[Array]] of the form [[1, 3], [4, 5]...]
19
+ #
20
+ def mk_distribution(*args)
21
+ flat = args.flatten
22
+ raw = flat.first.is_a?(String) ? flat.first.split : flat
23
+
24
+ hash = raw.each_with_object(Hash.new(0)) do |v, sum|
25
+ sum[v] += 1
26
+ sum
27
+ end
28
+
29
+ hash.to_a.map { |a, b| [b, a.to_f] }
30
+ end
31
+
32
+ def mk_wf_distribution(*args)
33
+ array2dist(mk_distribution(args))
34
+ end
35
+
36
+ def validation
37
+ :wf_distribution?
38
+ end
39
+
40
+ def default_port
41
+ 40000
42
+ end
43
+
44
+ # Convert a validated point to a string conforming to
45
+ # https://docs.wavefront.com/proxies_histograms.html. No
46
+ # validation is done here.
47
+ #
48
+ # @param point [Hash] a hash describing a distribution. See
49
+ # #write() for the format.
50
+ #
51
+ # rubocop:disable Metrics/AbcSize
52
+ def hash_to_wf(dist)
53
+ logger.log("writer subclass #{writer}", :debug)
54
+ format('!%s %i %s %s source=%s %s %s',
55
+ dist[:interval].to_s.upcase || raise,
56
+ parse_time(dist.fetch(:ts, Time.now)),
57
+ array2dist(dist[:value]),
58
+ dist[:path] || raise,
59
+ dist.fetch(:source, HOSTNAME),
60
+ dist[:tags] && dist[:tags].to_wf_tag,
61
+ opts[:tags] && opts[:tags].to_wf_tag).squeeze(' ').strip
62
+ rescue StandardError => e
63
+ puts e
64
+ raise Wavefront::Exception::InvalidDistribution
65
+ end
66
+ # rubocop:enable Metrics/AbcSize
67
+
68
+ # Turn an array of arrays into a the values part of a distribution
69
+ # @return [String]
70
+ #
71
+ def array2dist(values)
72
+ values.map { |x, v| format('#%i %s', x, v) }.join(' ')
73
+ end
74
+ end
75
+ end
@@ -1,11 +1,11 @@
1
- require_relative 'base'
1
+ require_relative 'core/api'
2
2
 
3
3
  module Wavefront
4
4
  #
5
5
  # View and manage events. Events are identified by their millisecond
6
6
  # epoch timestamp.
7
7
  #
8
- class Event < Base
8
+ class Event < CoreApi
9
9
  def update_keys
10
10
  %i[startTime endTime name annotations]
11
11
  end
@@ -38,7 +38,7 @@ module Wavefront
38
38
  cursor: cursor,
39
39
  limit: limit }
40
40
 
41
- api_get('', body.cleanse)
41
+ api.get('', body.cleanse)
42
42
  end
43
43
 
44
44
  # POST /api/v2/event
@@ -53,7 +53,7 @@ module Wavefront
53
53
  #
54
54
  def create(body)
55
55
  raise ArgumentError unless body.is_a?(Hash)
56
- api_post('', body, 'application/json')
56
+ api.post('', body, 'application/json')
57
57
  end
58
58
 
59
59
  # DELETE /api/v2/event/id
@@ -64,7 +64,7 @@ module Wavefront
64
64
  #
65
65
  def delete(id)
66
66
  wf_event_id?(id)
67
- api_delete(id)
67
+ api.delete(id)
68
68
  end
69
69
 
70
70
  # GET /api/v2/event/id
@@ -80,7 +80,7 @@ module Wavefront
80
80
  wf_version?(version) if version
81
81
  fragments = [id]
82
82
  fragments += ['history', version] if version
83
- api_get(fragments.uri_concat)
83
+ api.get(fragments.uri_concat)
84
84
  end
85
85
 
86
86
  # PUT /api/v2/event/id
@@ -100,9 +100,9 @@ module Wavefront
100
100
  wf_event_id?(id)
101
101
  raise ArgumentError unless body.is_a?(Hash)
102
102
 
103
- return api_put(id, body, 'application/json') unless modify
103
+ return api.put(id, body, 'application/json') unless modify
104
104
 
105
- api_put(id, hash_for_update(describe(id), body), 'application/json')
105
+ api.put(id, hash_for_update(describe(id), body), 'application/json')
106
106
  end
107
107
 
108
108
  # POST /api/v2/event/id/close
@@ -112,7 +112,7 @@ module Wavefront
112
112
  #
113
113
  def close(id)
114
114
  wf_event_id?(id)
115
- api_post([id, 'close'].uri_concat)
115
+ api.post([id, 'close'].uri_concat)
116
116
  end
117
117
 
118
118
  # GET /api/v2/event/id/tag
@@ -124,7 +124,7 @@ module Wavefront
124
124
  #
125
125
  def tags(id)
126
126
  wf_event_id?(id)
127
- api_get([id, 'tag'].uri_concat)
127
+ api.get([id, 'tag'].uri_concat)
128
128
  end
129
129
 
130
130
  # POST /api/v2/event/id/tag
@@ -139,7 +139,7 @@ module Wavefront
139
139
  wf_event_id?(id)
140
140
  tags = Array(tags)
141
141
  tags.each { |t| wf_string?(t) }
142
- api_post([id, 'tag'].uri_concat, tags, 'application/json')
142
+ api.post([id, 'tag'].uri_concat, tags, 'application/json')
143
143
  end
144
144
 
145
145
  # DELETE /api/v2/event/id/tag/tagValue
@@ -152,7 +152,7 @@ module Wavefront
152
152
  def tag_delete(id, tag)
153
153
  wf_event_id?(id)
154
154
  wf_string?(tag)
155
- api_delete([id, 'tag', tag].uri_concat)
155
+ api.delete([id, 'tag', tag].uri_concat)
156
156
  end
157
157
 
158
158
  # PUT /api/v2/event/id/tag/tagValue
@@ -165,7 +165,7 @@ module Wavefront
165
165
  def tag_add(id, tag)
166
166
  wf_event_id?(id)
167
167
  wf_string?(tag)
168
- api_put([id, 'tag', tag].uri_concat)
168
+ api.put([id, 'tag', tag].uri_concat)
169
169
  end
170
170
  end
171
171
  end
@@ -1,10 +1,10 @@
1
- require_relative 'base'
1
+ require_relative 'core/api'
2
2
 
3
3
  module Wavefront
4
4
  #
5
5
  # Manage and query Wavefront external links.
6
6
  #
7
- class ExternalLink < Base
7
+ class ExternalLink < CoreApi
8
8
  def api_base
9
9
  '/extlink'
10
10
  end
@@ -21,7 +21,7 @@ module Wavefront
21
21
  # @param limit [Int] the number of link to return
22
22
  #
23
23
  def list(offset = 0, limit = 100)
24
- api_get('', offset: offset, limit: limit)
24
+ api.get('', offset: offset, limit: limit)
25
25
  end
26
26
 
27
27
  # POST /api/v2/extlink
@@ -32,7 +32,7 @@ module Wavefront
32
32
  #
33
33
  def create(body)
34
34
  raise ArgumentError unless body.is_a?(Hash)
35
- api_post('', body, 'application/json')
35
+ api.post('', body, 'application/json')
36
36
  end
37
37
 
38
38
  # DELETE /api/v2/extlink/id
@@ -43,7 +43,7 @@ module Wavefront
43
43
  #
44
44
  def delete(id)
45
45
  wf_link_id?(id)
46
- api_delete(id)
46
+ api.delete(id)
47
47
  end
48
48
 
49
49
  # GET /api/v2/extlink/id
@@ -54,7 +54,7 @@ module Wavefront
54
54
  #
55
55
  def describe(id)
56
56
  wf_link_id?(id)
57
- api_get(id)
57
+ api.get(id)
58
58
  end
59
59
 
60
60
  # PUT /api/v2/extlink/id
@@ -72,9 +72,9 @@ module Wavefront
72
72
  wf_link_id?(id)
73
73
  raise ArgumentError unless body.is_a?(Hash)
74
74
 
75
- return api_put(id, body, 'application/json') unless modify
75
+ return api.put(id, body, 'application/json') unless modify
76
76
 
77
- api_put(id, hash_for_update(describe(id).response, body),
77
+ api.put(id, hash_for_update(describe(id).response, body),
78
78
  'application/json')
79
79
  end
80
80
  end