wavefront-sdk 7.0.0 → 8.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +3 -3
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +1 -1
- data/Gemfile +11 -0
- data/HISTORY.md +31 -4
- data/README.md +3 -3
- data/lib/wavefront-sdk/accesspolicy.rb +37 -0
- data/lib/wavefront-sdk/account.rb +28 -0
- data/lib/wavefront-sdk/alert.rb +29 -10
- data/lib/wavefront-sdk/api_mixins/tag.rb +12 -12
- data/lib/wavefront-sdk/apitoken.rb +29 -2
- data/lib/wavefront-sdk/cloudintegration.rb +10 -8
- data/lib/wavefront-sdk/cluster.rb +18 -0
- data/lib/wavefront-sdk/core/api_caller.rb +2 -2
- data/lib/wavefront-sdk/core/exception.rb +4 -0
- data/lib/wavefront-sdk/dashboard.rb +7 -6
- data/lib/wavefront-sdk/defs/version.rb +1 -1
- data/lib/wavefront-sdk/derivedmetric.rb +7 -6
- data/lib/wavefront-sdk/event.rb +5 -5
- data/lib/wavefront-sdk/externallink.rb +3 -3
- data/lib/wavefront-sdk/ingestionpolicy.rb +32 -5
- data/lib/wavefront-sdk/integration.rb +14 -4
- data/lib/wavefront-sdk/internals.rb +93 -0
- data/lib/wavefront-sdk/maintenancewindow.rb +3 -3
- data/lib/wavefront-sdk/message.rb +1 -1
- data/lib/wavefront-sdk/metricspolicy.rb +1 -1
- data/lib/wavefront-sdk/monitoredapplication.rb +55 -0
- data/lib/wavefront-sdk/notificant.rb +4 -4
- data/lib/wavefront-sdk/proxy.rb +26 -4
- data/lib/wavefront-sdk/role.rb +2 -2
- data/lib/wavefront-sdk/savedsearch.rb +4 -4
- data/lib/wavefront-sdk/search.rb +6 -4
- data/lib/wavefront-sdk/source.rb +6 -6
- data/lib/wavefront-sdk/spansamplingpolicy.rb +126 -0
- data/lib/wavefront-sdk/stdlib/string.rb +1 -1
- data/lib/wavefront-sdk/support/parse_time.rb +1 -1
- data/lib/wavefront-sdk/user.rb +5 -5
- data/lib/wavefront-sdk/usergroup.rb +2 -2
- data/lib/wavefront-sdk/validators.rb +28 -5
- data/lib/wavefront-sdk/webhook.rb +3 -3
- data/lib/wavefront-sdk/write.rb +1 -0
- data/lib/wavefront-sdk/writers/api.rb +31 -8
- data/lib/wavefront-sdk/writers/http.rb +2 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/wavefront-sdk/accesspolicy_spec.rb +53 -0
- data/spec/wavefront-sdk/account_spec.rb +32 -1
- data/spec/wavefront-sdk/alert_spec.rb +17 -0
- data/spec/wavefront-sdk/api_mixins/user_mixins_spec.rb +1 -1
- data/spec/wavefront-sdk/apitoken_spec.rb +12 -0
- data/spec/wavefront-sdk/cluster_spec.rb +13 -0
- data/spec/wavefront-sdk/core/api_caller_spec.rb +1 -1
- data/spec/wavefront-sdk/core/api_spec.rb +1 -1
- data/spec/wavefront-sdk/core/logger_spec.rb +1 -1
- data/spec/wavefront-sdk/core/response_spec.rb +1 -1
- data/spec/wavefront-sdk/credentials_spec.rb +2 -2
- data/spec/wavefront-sdk/distribution_spec.rb +1 -1
- data/spec/wavefront-sdk/ingestionpolicy_spec.rb +11 -0
- data/spec/wavefront-sdk/integration_spec.rb +4 -0
- data/spec/wavefront-sdk/internals_spec.rb +62 -0
- data/spec/wavefront-sdk/metric_helper_spec.rb +1 -1
- data/spec/wavefront-sdk/misc_spec.rb +1 -1
- data/spec/wavefront-sdk/monitoredapplication_spec.rb +35 -0
- data/spec/wavefront-sdk/paginator/base_spec.rb +1 -1
- data/spec/wavefront-sdk/paginator/post_spec.rb +1 -1
- data/spec/wavefront-sdk/proxy_spec.rb +14 -0
- data/spec/wavefront-sdk/resources/swagger.spec.gz +0 -0
- data/spec/wavefront-sdk/spansamplingpolicy_spec.rb +47 -0
- data/spec/wavefront-sdk/spy_spec.rb +1 -1
- data/spec/wavefront-sdk/stdlib/array_spec.rb +1 -1
- data/spec/wavefront-sdk/stdlib/hash_spec.rb +1 -1
- data/spec/wavefront-sdk/stdlib/string_spec.rb +1 -1
- data/spec/wavefront-sdk/support/mixins_spec.rb +1 -1
- data/spec/wavefront-sdk/support/parse_time_spec.rb +1 -1
- data/spec/wavefront-sdk/unstable/chart_spec.rb +1 -1
- data/spec/wavefront-sdk/usage_spec.rb +0 -1
- data/spec/wavefront-sdk/validators_spec.rb +17 -1
- data/spec/wavefront-sdk/write_spec.rb +1 -1
- data/spec/wavefront-sdk/writers/api_spec.rb +1 -1
- data/spec/wavefront-sdk/writers/core_spec.rb +1 -1
- data/spec/wavefront-sdk/writers/http_spec.rb +1 -1
- data/spec/wavefront-sdk/writers/proxy_spec.rb +1 -1
- data/spec/wavefront-sdk/writers/socket_spec.rb +1 -1
- data/spec/wavefront-sdk/writers/summary_spec.rb +1 -1
- data/wavefront-sdk.gemspec +2 -13
- metadata +17 -146
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aaa122c93ee064de7ab83a6a268df760076b10e0eaa58e975cda7e948fa04e1
|
4
|
+
data.tar.gz: 5a44f647c489399bc3039a12141e43f55f89960770231d12c1862c9d9f3ecf53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4076582f567b202c58a84f7dbdaa69551a48672854e729c71861702b161a705c670adb0c5e6fb3daf857712961a42dc9b351fb888c485429fc946865130a6a8a
|
7
|
+
data.tar.gz: 39036b8aebfc25a7eef8e47647d38f6afc14aa44bffda3618793342d4e459d2a825eeaa86fb01be22a343d79d24bd5f8d78010e2f797a25b904e1e5bce06f006
|
@@ -15,10 +15,10 @@ jobs:
|
|
15
15
|
- name: Set env
|
16
16
|
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
|
17
17
|
|
18
|
-
- name: Set up Ruby 3.
|
18
|
+
- name: Set up Ruby 3.2
|
19
19
|
uses: ruby/setup-ruby@v1
|
20
20
|
with:
|
21
|
-
ruby-version: 3.
|
21
|
+
ruby-version: 3.2
|
22
22
|
- run: bundle install
|
23
23
|
|
24
24
|
- name: Run tests
|
@@ -34,4 +34,4 @@ jobs:
|
|
34
34
|
chmod 0600 ${HOME}/.gem/credentials
|
35
35
|
gem push pkg/*.gem
|
36
36
|
env:
|
37
|
-
GEM_HOST_API_KEY: "${{secrets.
|
37
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_PUSH_KEY}}"
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,3 +2,14 @@
|
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
gem 'minitest', '~> 5.17', group: :development
|
7
|
+
gem 'rake', '~> 13.0', group: :development
|
8
|
+
gem 'rubocop', '~> 1.51', group: :development
|
9
|
+
gem 'rubocop-minitest', '~> 0.31', group: :development
|
10
|
+
gem 'rubocop-performance', '~> 1.19', group: :development
|
11
|
+
gem 'rubocop-rake', '~> 0.6', group: :development
|
12
|
+
gem 'simplecov', '~> 0.22', group: :development
|
13
|
+
gem 'spy', '~> 1.0', group: :development
|
14
|
+
gem 'webmock', '~> 3.19', group: :development
|
15
|
+
gem 'yard', '~> 0.9', group: :development
|
data/HISTORY.md
CHANGED
@@ -1,5 +1,32 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 8.0.1 (2024-01-19)
|
4
|
+
* Add an empty `Wavefront::Writer::Http#close` method, which some clients
|
5
|
+
expect to exist.
|
6
|
+
|
7
|
+
## 8.0.0 (2023-09-06)
|
8
|
+
* Drop support for Ruby 2.7 (Breaking change.)
|
9
|
+
* Correctly report errors when sending points to API.
|
10
|
+
* Bump dependencies.
|
11
|
+
* Add `Wavefront::AccessPolicy` class.
|
12
|
+
* Add `Wavefront::Cluster` class to cover "wavefront" endpoint.
|
13
|
+
* Add `Wavefront::Alert#check_query`.
|
14
|
+
* Add `Wavefront::Alert#preview`.
|
15
|
+
* Add `Wavefront::Internal` class to show API coverage.
|
16
|
+
* Add `Wavefront::Account#admins`.
|
17
|
+
* Add `Wavefront::Account#update_perms`.
|
18
|
+
* Add `Wavefront::Integration#manifest_min`.
|
19
|
+
* Add `Wavefront::Proxy#config`.
|
20
|
+
* Add `Wavefront::Proxy#preprocessor_rules`.
|
21
|
+
* Add `version` parameter to `Wavefront::IngestionPolicy#describe`.
|
22
|
+
* Add `Wavefront::IngestionPolicy#history`.
|
23
|
+
* Add `Wavefront::IngestionPolicy#revert`.
|
24
|
+
* Add `Wavefront::ApiToken#list_customer_tokens`.
|
25
|
+
* Add `Wavefront::ApiToken#describe_customer_token`.
|
26
|
+
* Add `Wavefront::ApiToken#revoke_customer_token`, though it does nothing.
|
27
|
+
* Add `Wavefront::MonitoredApplication` class.
|
28
|
+
* Add `Wavefront::SpanSamplingPolicy` class.
|
29
|
+
|
3
30
|
## 7.0.0 (2023-01-19)
|
4
31
|
* Drop support for Ruby 2.5. (Breaking change.)
|
5
32
|
* Drop support for Ruby 2.6. (Breaking change.)
|
@@ -10,10 +37,10 @@
|
|
10
37
|
* Change the name of the proxy writer from `socket` to `proxy`. (Breaking
|
11
38
|
change.)
|
12
39
|
* Change the name of the Unix datagram socket writer from `unix` to `socket`.
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
40
|
+
* Add `Wavefront::Event#alert_firing_details`.
|
41
|
+
* Add `Wavefront::Event#alert_queries_slug`.
|
42
|
+
* Add `Wavefront::Event#events`.
|
43
|
+
* Add `Wavefront::Event#alert_firings`.
|
17
44
|
* Add `Wavefront::MetricsPolicy`.
|
18
45
|
* Add `Wavefront::Spy#deltas`.
|
19
46
|
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# wavefront-sdk
|
2
|
-
[![Test](https://github.com/snltd/wavefront-sdk/actions/workflows/test.yml/badge.svg
|
3
|
-
|
2
|
+
[![Test](https://github.com/snltd/wavefront-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/snltd/wavefront-sdk/actions/workflows/test.yml) [![Release](https://github.com/snltd/wavefront-sdk/actions/workflows/release.yml/badge.svg)](https://github.com/snltd/wavefront-sdk/actions/workflows/release.yml) [![Gem Version](https://badge.fury.io/rb/wavefront-sdk.png)](https://badge.fury.io/rb/wavefront-sdk)
|
3
|
+
|
4
4
|
This is a Ruby SDK for v2 of
|
5
5
|
[Wavefront](https://www.wavefront.com/)'s public API. It aims to be
|
6
6
|
more lightweight, consistent, simple, and convenient than an
|
@@ -24,7 +24,7 @@ or to build locally,
|
|
24
24
|
$ gem build wavefront-sdk.gemspec
|
25
25
|
```
|
26
26
|
|
27
|
-
`wavefront-sdk` requires Ruby >=
|
27
|
+
`wavefront-sdk` requires Ruby >= 3.0. All its dependencies are pure
|
28
28
|
Ruby, right the way down, so a compiler should never be required to
|
29
29
|
install it.
|
30
30
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'core/api'
|
4
|
+
|
5
|
+
module Wavefront
|
6
|
+
#
|
7
|
+
# Manage and query the Wavefront access policy
|
8
|
+
#
|
9
|
+
class AccessPolicy < CoreApi
|
10
|
+
# GET /api/v2/accesspolicy
|
11
|
+
# Get the access policy
|
12
|
+
# @return [Wavefront::Response]
|
13
|
+
#
|
14
|
+
def describe
|
15
|
+
api.get('')
|
16
|
+
end
|
17
|
+
|
18
|
+
# PUT /api/v2/accesspolicy
|
19
|
+
# Update the access policy
|
20
|
+
# @param body [Hash] hash describing access policy
|
21
|
+
# @return [Wavefront::Response]
|
22
|
+
#
|
23
|
+
def update(body)
|
24
|
+
raise ArgumentError unless body.is_a?(Hash)
|
25
|
+
|
26
|
+
api.put('', body, 'application/json')
|
27
|
+
end
|
28
|
+
|
29
|
+
# GET /api/v2/accesspolicy/validate
|
30
|
+
# Validate a given url and ip address
|
31
|
+
# @return [Wavefront::Response]
|
32
|
+
#
|
33
|
+
def validate(ip)
|
34
|
+
api.get('validate', ip: ip)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -44,6 +44,34 @@ module Wavefront
|
|
44
44
|
api.get(id)
|
45
45
|
end
|
46
46
|
|
47
|
+
# GET /api/v2/account/user/admin
|
48
|
+
# Get all users with Accounts permission
|
49
|
+
#
|
50
|
+
def admins
|
51
|
+
api.get('user/admin')
|
52
|
+
end
|
53
|
+
|
54
|
+
# PUT /api/v2/account/user/{id}
|
55
|
+
# Update user with given user groups and permissions.
|
56
|
+
#
|
57
|
+
# @param id [String] a Wavefront account ID
|
58
|
+
# @param body [Hash] key-value hash of the parameters you wish
|
59
|
+
# to change
|
60
|
+
# @param modify [true, false] if true, use {#describe()} to get
|
61
|
+
# a hash describing the existing object, and modify that with
|
62
|
+
# the new body. If false, pass the new body straight through.
|
63
|
+
# @return [Wavefront::Response]
|
64
|
+
#
|
65
|
+
def update_perms(id, body, modify = true)
|
66
|
+
wf_account_id?(id)
|
67
|
+
raise ArgumentError unless body.is_a?(Hash)
|
68
|
+
|
69
|
+
return api.put(['user', id], body, 'application/json') unless modify
|
70
|
+
|
71
|
+
api.put(['user', id], hash_for_update(describe(id).response, body),
|
72
|
+
'application/json')
|
73
|
+
end
|
74
|
+
|
47
75
|
# POST /api/v2/account/{id}/addRoles
|
48
76
|
# Add specific roles to the account (user or service account)
|
49
77
|
# @param id [String] ID of the account
|
data/lib/wavefront-sdk/alert.rb
CHANGED
@@ -44,7 +44,7 @@ module Wavefront
|
|
44
44
|
api.post('', body, 'application/json')
|
45
45
|
end
|
46
46
|
|
47
|
-
# DELETE /api/v2/alert/id
|
47
|
+
# DELETE /api/v2/alert/{id}
|
48
48
|
# Delete a specific alert.
|
49
49
|
#
|
50
50
|
# Deleting an active alert moves it to 'trash', from where it can
|
@@ -59,8 +59,8 @@ module Wavefront
|
|
59
59
|
api.delete(id)
|
60
60
|
end
|
61
61
|
|
62
|
-
# GET /api/v2/alert/id
|
63
|
-
# GET /api/v2/alert/id/history/version
|
62
|
+
# GET /api/v2/alert/{id}
|
63
|
+
# GET /api/v2/alert/{id}/history/{version}
|
64
64
|
# Get a specific alert / Get a specific historical version of a
|
65
65
|
# specific alert.
|
66
66
|
#
|
@@ -76,9 +76,10 @@ module Wavefront
|
|
76
76
|
api.get(fragments.uri_concat)
|
77
77
|
end
|
78
78
|
|
79
|
-
#
|
79
|
+
# GET /api/v2/alert/{id}/history
|
80
|
+
# Get the version history of a specific alert
|
80
81
|
# @param id [String] ID of the alert
|
81
|
-
# @
|
82
|
+
# @return [Wavefront::Response]
|
82
83
|
#
|
83
84
|
def versions(id)
|
84
85
|
wf_alert_id?(id)
|
@@ -91,7 +92,7 @@ module Wavefront
|
|
91
92
|
resp
|
92
93
|
end
|
93
94
|
|
94
|
-
# PUT /api/v2/alert/id
|
95
|
+
# PUT /api/v2/alert/{id}
|
95
96
|
# Update a specific alert.
|
96
97
|
#
|
97
98
|
# @param id [String] a Wavefront alert ID
|
@@ -128,7 +129,7 @@ module Wavefront
|
|
128
129
|
v: version }, 'application/json')
|
129
130
|
end
|
130
131
|
|
131
|
-
# GET /api/v2/alert/id/history
|
132
|
+
# GET /api/v2/alert/{id}/history
|
132
133
|
# Get the version history of a specific alert.
|
133
134
|
#
|
134
135
|
# @param id [String] ID of the alert
|
@@ -151,7 +152,7 @@ module Wavefront
|
|
151
152
|
api.post([id, 'install'].uri_concat, nil)
|
152
153
|
end
|
153
154
|
|
154
|
-
# POST /api/v2/alert/id/snooze
|
155
|
+
# POST /api/v2/alert/{id}/snooze
|
155
156
|
# Snooze a specific alert for some number of seconds.
|
156
157
|
#
|
157
158
|
# @param id [String] ID of the alert
|
@@ -169,7 +170,7 @@ module Wavefront
|
|
169
170
|
wf_alert_id?(id)
|
170
171
|
end
|
171
172
|
|
172
|
-
# POST /api/v2/alert/id/undelete
|
173
|
+
# POST /api/v2/alert/{id}/undelete
|
173
174
|
# Undelete a specific alert.
|
174
175
|
#
|
175
176
|
# @param id [String] ID of the alert
|
@@ -188,7 +189,7 @@ module Wavefront
|
|
188
189
|
api.post([id, 'uninstall'].uri_concat, nil)
|
189
190
|
end
|
190
191
|
|
191
|
-
# POST /api/v2/alert/id/unsnooze
|
192
|
+
# POST /api/v2/alert/{id}/unsnooze
|
192
193
|
# Unsnooze a specific alert.
|
193
194
|
#
|
194
195
|
# @param id [String] ID of the alert
|
@@ -199,6 +200,24 @@ module Wavefront
|
|
199
200
|
api.post([id, 'unsnooze'].uri_concat)
|
200
201
|
end
|
201
202
|
|
203
|
+
# POST /api/v2/alert/checkQuery
|
204
|
+
# Return the type of provided query.
|
205
|
+
# @param query [Hash] description of query
|
206
|
+
# @return [Wavefront::Response]
|
207
|
+
#
|
208
|
+
def check_query(query)
|
209
|
+
api.post('checkQuery', query, 'application/json')
|
210
|
+
end
|
211
|
+
|
212
|
+
# POST /api/v2/alert/preview
|
213
|
+
# Get all the notification preview for a specific alert
|
214
|
+
# @param alert [Hash] description of alert
|
215
|
+
# @return [Wavefront::Response]
|
216
|
+
#
|
217
|
+
def preview(alert)
|
218
|
+
api.post('preview', alert, 'application/json')
|
219
|
+
end
|
220
|
+
|
202
221
|
# GET /api/v2/alert/summary
|
203
222
|
# Count alerts of various statuses for a customer
|
204
223
|
#
|
@@ -9,10 +9,10 @@ module Wavefront
|
|
9
9
|
# valid_id? method to perform ID validation.
|
10
10
|
#
|
11
11
|
module Tag
|
12
|
-
# GET /api/v2/{
|
13
|
-
# Get all tags associated with a specific
|
12
|
+
# GET /api/v2/{entity}/{id}/tag
|
13
|
+
# Get all tags associated with a specific entity.
|
14
14
|
#
|
15
|
-
# @param id [String] ID of the
|
15
|
+
# @param id [String] ID of the entity
|
16
16
|
# @return [Wavefront::Response]
|
17
17
|
#
|
18
18
|
def tags(id)
|
@@ -20,10 +20,10 @@ module Wavefront
|
|
20
20
|
api.get([id, 'tag'].uri_concat)
|
21
21
|
end
|
22
22
|
|
23
|
-
# POST /api/v2/{
|
24
|
-
# Set all tags associated with a specific
|
23
|
+
# POST /api/v2/{entity}/{id}/tag
|
24
|
+
# Set all tags associated with a specific entity.
|
25
25
|
#
|
26
|
-
# @param id [String] ID of the
|
26
|
+
# @param id [String] ID of the entity
|
27
27
|
# @param tags [Array] list of tags to set.
|
28
28
|
# @return [Wavefront::Response]
|
29
29
|
#
|
@@ -34,10 +34,10 @@ module Wavefront
|
|
34
34
|
api.post([id, 'tag'].uri_concat, tags.to_json, 'application/json')
|
35
35
|
end
|
36
36
|
|
37
|
-
# DELETE /api/v2/{
|
38
|
-
# Remove a tag from a specific
|
37
|
+
# DELETE /api/v2/{entity}/{id}/tag/{tagValue}
|
38
|
+
# Remove a tag from a specific entity.
|
39
39
|
#
|
40
|
-
# @param id [String] ID of the
|
40
|
+
# @param id [String] ID of the entity
|
41
41
|
# @param tag [String] tag to delete
|
42
42
|
# @return [Wavefront::Response]
|
43
43
|
#
|
@@ -47,10 +47,10 @@ module Wavefront
|
|
47
47
|
api.delete([id, 'tag', tag].uri_concat)
|
48
48
|
end
|
49
49
|
|
50
|
-
# PUT /api/v2/{
|
51
|
-
# Add a tag to a specific
|
50
|
+
# PUT /api/v2/{entity}/{id}/tag/{tagValue}
|
51
|
+
# Add a tag to a specific entity.
|
52
52
|
#
|
53
|
-
# @param id [String] ID of the
|
53
|
+
# @param id [String] ID of the entity
|
54
54
|
# @param tag [String] tag to set.
|
55
55
|
# @return [Wavefront::Response]
|
56
56
|
#
|
@@ -25,7 +25,25 @@ module Wavefront
|
|
25
25
|
api.post('', nil, 'application/json')
|
26
26
|
end
|
27
27
|
|
28
|
-
#
|
28
|
+
# GET /api/v2/apitoken/customertokens
|
29
|
+
# Get all api tokens for a customer
|
30
|
+
#
|
31
|
+
def list_customer_tokens
|
32
|
+
api.get('customertokens')
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /api/v2/apitoken/customertokens/{id}
|
36
|
+
# Get the specified api token for a customer
|
37
|
+
#
|
38
|
+
# @param id [String] ID of the api token
|
39
|
+
# @return [Wavefront::Response]
|
40
|
+
#
|
41
|
+
def describe_customer_token(id)
|
42
|
+
wf_apitoken_id?(id)
|
43
|
+
api.get(['customertokens', id].uri_concat)
|
44
|
+
end
|
45
|
+
|
46
|
+
# DELETE /api/v2/apitoken/{id}
|
29
47
|
# Delete the specified api token
|
30
48
|
#
|
31
49
|
# @param id [String] ID of the api token
|
@@ -36,7 +54,7 @@ module Wavefront
|
|
36
54
|
api.delete(id)
|
37
55
|
end
|
38
56
|
|
39
|
-
# PUT /api/v2/apitoken/id
|
57
|
+
# PUT /api/v2/apitoken/{id}
|
40
58
|
# Update the name of the specified api token
|
41
59
|
#
|
42
60
|
# @param id [String] ID of the API token
|
@@ -99,5 +117,14 @@ module Wavefront
|
|
99
117
|
api.put(['serviceaccount', id, token_id].uri_concat,
|
100
118
|
{ tokenID: token_id, tokenName: name }, 'application/json')
|
101
119
|
end
|
120
|
+
|
121
|
+
# PUT /api/v2/apitoken/customertokens/revoke
|
122
|
+
# Delete the specified api token for a customer
|
123
|
+
#
|
124
|
+
# This appears to be only for use by the web API.
|
125
|
+
#
|
126
|
+
def revoke_customer_token
|
127
|
+
raise 'Unsupported API path'
|
128
|
+
end
|
102
129
|
end
|
103
130
|
end
|
@@ -32,7 +32,7 @@ module Wavefront
|
|
32
32
|
api.post('', body, 'application/json')
|
33
33
|
end
|
34
34
|
|
35
|
-
# DELETE /api/v2/cloudintegration/id
|
35
|
+
# DELETE /api/v2/cloudintegration/{id}
|
36
36
|
# Delete a specific cloud integration
|
37
37
|
#
|
38
38
|
# Deleting an active integration moves it to 'trash', from where
|
@@ -47,7 +47,7 @@ module Wavefront
|
|
47
47
|
api.delete(id)
|
48
48
|
end
|
49
49
|
|
50
|
-
# GET /api/v2/cloudintegration/id
|
50
|
+
# GET /api/v2/cloudintegration/{id}
|
51
51
|
# Get a specific cloud integration
|
52
52
|
#
|
53
53
|
# @param id [String] ID of the integration
|
@@ -58,7 +58,7 @@ module Wavefront
|
|
58
58
|
api.get(id)
|
59
59
|
end
|
60
60
|
|
61
|
-
# PUT /api/v2/cloudintegration/id
|
61
|
+
# PUT /api/v2/cloudintegration/{id}
|
62
62
|
# Update a specific cloud integration
|
63
63
|
#
|
64
64
|
# @param id [String] ID of the integration
|
@@ -91,7 +91,7 @@ module Wavefront
|
|
91
91
|
api.post([id, 'enable'].uri_concat)
|
92
92
|
end
|
93
93
|
|
94
|
-
# POST /api/v2/cloudintegration/id/undelete
|
94
|
+
# POST /api/v2/cloudintegration/{id}/undelete
|
95
95
|
# Undelete a specific cloud integration
|
96
96
|
#
|
97
97
|
# @param id [String] ID of the integration
|
@@ -102,14 +102,16 @@ module Wavefront
|
|
102
102
|
api.post([id, 'undelete'].uri_concat)
|
103
103
|
end
|
104
104
|
|
105
|
-
# POST /api/v2/cloudintegration/
|
105
|
+
# POST /api/v2/cloudintegration/awsExternalId
|
106
|
+
# Create an external id
|
106
107
|
# @return [Wavefront::Response]
|
107
108
|
#
|
108
109
|
def create_aws_external_id
|
109
110
|
api.post('awsExternalId', nil, 'application/json')
|
110
111
|
end
|
111
112
|
|
112
|
-
# DELETE /api/v2/cloudintegration/awsExternalId/{id}
|
113
|
+
# DELETE /api/v2/cloudintegration/awsExternalId/{id}
|
114
|
+
# Deletes an external id
|
113
115
|
# that was created by Wavefront
|
114
116
|
# @param id [String] AWS external ID
|
115
117
|
# @return [Wavefront::Response]
|
@@ -119,8 +121,8 @@ module Wavefront
|
|
119
121
|
api.delete(['awsExternalId', external_id].uri_concat)
|
120
122
|
end
|
121
123
|
|
122
|
-
# GET /api/v2/cloudintegration/awsExternalId/{id}
|
123
|
-
# external id that was created by Wavefront
|
124
|
+
# GET /api/v2/cloudintegration/awsExternalId/{id}
|
125
|
+
# GETs (confirms) a valid external id that was created by Wavefront
|
124
126
|
# @param id [String] AWS external ID
|
125
127
|
# @return [Wavefront::Response]
|
126
128
|
#
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'core/api'
|
4
|
+
|
5
|
+
module Wavefront
|
6
|
+
#
|
7
|
+
# Query Wavefront cluster info. The API docs call this "wavefront", but that
|
8
|
+
# confuses everything.
|
9
|
+
#
|
10
|
+
class Cluster < CoreApi
|
11
|
+
# GET /api/v2/cluster/info
|
12
|
+
# get cluster info
|
13
|
+
#
|
14
|
+
def describe
|
15
|
+
api.get('info')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -133,8 +133,8 @@ module Wavefront
|
|
133
133
|
#
|
134
134
|
def post(path, body = nil, ctype = 'text/plain')
|
135
135
|
body = body.to_json unless body.is_a?(String)
|
136
|
-
make_call(mk_conn(path,
|
137
|
-
|
136
|
+
make_call(mk_conn(path, 'Content-Type': ctype,
|
137
|
+
Accept: 'application/json'),
|
138
138
|
:post, nil, body)
|
139
139
|
end
|
140
140
|
|
@@ -53,6 +53,8 @@ module Wavefront
|
|
53
53
|
|
54
54
|
class InvalidMaintenanceWindowId < RuntimeError; end
|
55
55
|
|
56
|
+
class InvalidMonitoredApplicationId < RuntimeError; end
|
57
|
+
|
56
58
|
class InvalidMonitoredClusterId < RuntimeError; end
|
57
59
|
|
58
60
|
class InvalidMessageId < RuntimeError; end
|
@@ -89,6 +91,8 @@ module Wavefront
|
|
89
91
|
|
90
92
|
class InvalidSourceId < RuntimeError; end
|
91
93
|
|
94
|
+
class InvalidSpanSamplingPolicyId < RuntimeError; end
|
95
|
+
|
92
96
|
class InvalidString < RuntimeError; end
|
93
97
|
|
94
98
|
class InvalidTag < RuntimeError; end
|
@@ -40,7 +40,7 @@ module Wavefront
|
|
40
40
|
api.post('', body, 'application/json')
|
41
41
|
end
|
42
42
|
|
43
|
-
# DELETE /api/v2/dashboard/id
|
43
|
+
# DELETE /api/v2/dashboard/{id}
|
44
44
|
# Delete a specific dashboard.
|
45
45
|
# Deleting an active dashboard moves it to 'trash', from where
|
46
46
|
# it can be restored with an #undelete operation. Deleting a
|
@@ -54,7 +54,8 @@ module Wavefront
|
|
54
54
|
api.delete(id)
|
55
55
|
end
|
56
56
|
|
57
|
-
# GET /api/v2/dashboard/id
|
57
|
+
# GET /api/v2/dashboard/{id}
|
58
|
+
# GET /api/v2/dashboard/{id}/history/{version}
|
58
59
|
# Get a specific dashboard / Get a specific historical version
|
59
60
|
# of a specific dashboard.
|
60
61
|
#
|
@@ -70,10 +71,10 @@ module Wavefront
|
|
70
71
|
api.get(fragments.uri_concat)
|
71
72
|
end
|
72
73
|
|
73
|
-
# PUT /api/v2/dashboard/id
|
74
|
+
# PUT /api/v2/dashboard/{id}
|
74
75
|
# Update a specific dashboard.
|
75
76
|
#
|
76
|
-
# @param id [String] a Wavefront
|
77
|
+
# @param id [String] a Wavefront dashboard ID
|
77
78
|
# @param body [Hash] key-value hash of the parameters you wish
|
78
79
|
# to change
|
79
80
|
# @param modify [true, false] if true, use {#describe()} to get
|
@@ -103,7 +104,7 @@ module Wavefront
|
|
103
104
|
end
|
104
105
|
alias favourite favorite
|
105
106
|
|
106
|
-
# GET /api/v2/dashboard/id/history
|
107
|
+
# GET /api/v2/dashboard/{id}/history
|
107
108
|
# Get the version history of a dashboard.
|
108
109
|
#
|
109
110
|
# @param id [String] ID of the dashboard
|
@@ -114,7 +115,7 @@ module Wavefront
|
|
114
115
|
api.get([id, 'history'].uri_concat)
|
115
116
|
end
|
116
117
|
|
117
|
-
# POST /api/v2/dashboard/id/undelete
|
118
|
+
# POST /api/v2/dashboard/{id}/undelete
|
118
119
|
# Move a dashboard from 'trash' back into active service.
|
119
120
|
#
|
120
121
|
# @param id [String] ID of the dashboard
|
@@ -34,7 +34,7 @@ module Wavefront
|
|
34
34
|
api.post('', body, 'application/json')
|
35
35
|
end
|
36
36
|
|
37
|
-
# DELETE /api/v2/derivedmetric/id
|
37
|
+
# DELETE /api/v2/derivedmetric/{id}
|
38
38
|
# Delete a specific derived metric definition.
|
39
39
|
# Deleting an active derived metric moves it to 'trash', from
|
40
40
|
# where it can be restored with an #undelete operation. Deleting
|
@@ -48,7 +48,8 @@ module Wavefront
|
|
48
48
|
api.delete(id)
|
49
49
|
end
|
50
50
|
|
51
|
-
# GET /api/v2/derivedmetric/id
|
51
|
+
# GET /api/v2/derivedmetric/{id}
|
52
|
+
# GET /api/v2/derivedmetric/{id}/history/{version}
|
52
53
|
# Get a specific derived metric definition / Get a specific
|
53
54
|
# historical version of a specific derived metric definition.
|
54
55
|
#
|
@@ -64,10 +65,10 @@ module Wavefront
|
|
64
65
|
api.get(fragments.uri_concat)
|
65
66
|
end
|
66
67
|
|
67
|
-
# PUT /api/v2/derivedmetric/id
|
68
|
+
# PUT /api/v2/derivedmetric/{id}
|
68
69
|
# Update a specific derived metric definition.
|
69
70
|
#
|
70
|
-
# @param id [String] a Wavefront
|
71
|
+
# @param id [String] a Wavefront derived metric ID
|
71
72
|
# @param body [Hash] key-value hash of the parameters you wish
|
72
73
|
# to change
|
73
74
|
# @param modify [true, false] if true, use {#describe()} to get
|
@@ -85,7 +86,7 @@ module Wavefront
|
|
85
86
|
'application/json')
|
86
87
|
end
|
87
88
|
|
88
|
-
# GET /api/v2/derivedmetric/id/history
|
89
|
+
# GET /api/v2/derivedmetric/{id}/history
|
89
90
|
# Get the version history of a derived metric definition.
|
90
91
|
#
|
91
92
|
# @param id [String] ID of the derived metric
|
@@ -96,7 +97,7 @@ module Wavefront
|
|
96
97
|
api.get([id, 'history'].uri_concat)
|
97
98
|
end
|
98
99
|
|
99
|
-
# POST /api/v2/derivedmetric/id/undelete
|
100
|
+
# POST /api/v2/derivedmetric/{id}/undelete
|
100
101
|
# Move a derived metric definition from 'trash' back into active
|
101
102
|
# service.
|
102
103
|
#
|