dogapi 1.27.0 → 1.28.0
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -1
- data/.rubocop_todo.yml +458 -0
- data/.travis.yml +2 -3
- data/CHANGELOG.md +9 -0
- data/Gemfile +1 -5
- data/Rakefile +2 -18
- data/lib/capistrano/datadog.rb +2 -1
- data/lib/dogapi/facade.rb +9 -2
- data/lib/dogapi/v1/monitor.rb +11 -2
- data/lib/dogapi/v1/user.rb +2 -1
- data/lib/dogapi/version.rb +1 -1
- data/spec/integration/monitor_spec.rb +6 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94170fa0c3d3afae7fe1c1b1fac4bd16570f9bf9
|
|
4
|
+
data.tar.gz: c1d8f67c1edc5864146403efcdda5626afa42ba6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27a4a92628e88d8c4de9ca4c39511d38528b641f2bdd4114dbdef8bb47ca76b4a2d69b7f499d25e8e9fd07f56c5ae4616eb768bc4ff79bb661abbed334c814b0
|
|
7
|
+
data.tar.gz: 93b1e477f449399b2954cf68d615f3c8cf7c0950ef771a6220ad1677d6d26ddc27e3fdbe21b9e93ba989cc6ada268afc791f33ab3a9da11a8ed8326a577b8e42
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config`
|
|
3
|
+
# on 2017-05-17 13:09:19 -0400 using RuboCop version 0.41.2.
|
|
4
|
+
# The point is for the user to remove these configuration records
|
|
5
|
+
# one by one as the offenses are removed from the code base.
|
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
+
|
|
9
|
+
# Offense count: 1
|
|
10
|
+
# Cop supports --auto-correct.
|
|
11
|
+
# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
|
|
12
|
+
# SupportedStyles: keyword, variable, start_of_line
|
|
13
|
+
Lint/EndAlignment:
|
|
14
|
+
Exclude:
|
|
15
|
+
- 'lib/capistrano/datadog.rb'
|
|
16
|
+
|
|
17
|
+
# Offense count: 1
|
|
18
|
+
Lint/EnsureReturn:
|
|
19
|
+
Exclude:
|
|
20
|
+
- 'lib/dogapi/event.rb'
|
|
21
|
+
|
|
22
|
+
# Offense count: 2
|
|
23
|
+
Lint/RescueException:
|
|
24
|
+
Exclude:
|
|
25
|
+
- 'lib/dogapi/common.rb'
|
|
26
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
27
|
+
|
|
28
|
+
# Offense count: 2
|
|
29
|
+
# Cop supports --auto-correct.
|
|
30
|
+
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
|
|
31
|
+
Lint/UnusedBlockArgument:
|
|
32
|
+
Exclude:
|
|
33
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
34
|
+
|
|
35
|
+
# Offense count: 1
|
|
36
|
+
# Cop supports --auto-correct.
|
|
37
|
+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
|
|
38
|
+
Lint/UnusedMethodArgument:
|
|
39
|
+
Exclude:
|
|
40
|
+
- 'lib/dogapi/event.rb'
|
|
41
|
+
|
|
42
|
+
# Offense count: 2
|
|
43
|
+
Lint/UselessAssignment:
|
|
44
|
+
Exclude:
|
|
45
|
+
- 'lib/capistrano/datadog.rb'
|
|
46
|
+
|
|
47
|
+
# Offense count: 11
|
|
48
|
+
Metrics/AbcSize:
|
|
49
|
+
Max: 50
|
|
50
|
+
|
|
51
|
+
# Offense count: 1
|
|
52
|
+
# Configuration parameters: CountComments.
|
|
53
|
+
Metrics/ClassLength:
|
|
54
|
+
Max: 269
|
|
55
|
+
|
|
56
|
+
# Offense count: 1
|
|
57
|
+
Metrics/CyclomaticComplexity:
|
|
58
|
+
Max: 7
|
|
59
|
+
|
|
60
|
+
# Offense count: 15
|
|
61
|
+
# Configuration parameters: CountComments.
|
|
62
|
+
Metrics/MethodLength:
|
|
63
|
+
Max: 33
|
|
64
|
+
|
|
65
|
+
# Offense count: 2
|
|
66
|
+
# Configuration parameters: CountKeywordArgs.
|
|
67
|
+
Metrics/ParameterLists:
|
|
68
|
+
Max: 7
|
|
69
|
+
|
|
70
|
+
# Offense count: 1
|
|
71
|
+
Metrics/PerceivedComplexity:
|
|
72
|
+
Max: 8
|
|
73
|
+
|
|
74
|
+
# Offense count: 10
|
|
75
|
+
Style/AccessorMethodName:
|
|
76
|
+
Exclude:
|
|
77
|
+
- 'lib/dogapi/facade.rb'
|
|
78
|
+
- 'lib/dogapi/v1/alert.rb'
|
|
79
|
+
- 'lib/dogapi/v1/dash.rb'
|
|
80
|
+
- 'lib/dogapi/v1/embed.rb'
|
|
81
|
+
- 'lib/dogapi/v1/screenboard.rb'
|
|
82
|
+
- 'lib/dogapi/v1/user.rb'
|
|
83
|
+
|
|
84
|
+
# Offense count: 1
|
|
85
|
+
# Cop supports --auto-correct.
|
|
86
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
87
|
+
# SupportedStyles: prefer_alias, prefer_alias_method
|
|
88
|
+
Style/Alias:
|
|
89
|
+
Exclude:
|
|
90
|
+
- 'lib/capistrano/datadog/v3.rb'
|
|
91
|
+
|
|
92
|
+
# Offense count: 7
|
|
93
|
+
# Cop supports --auto-correct.
|
|
94
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
|
|
95
|
+
# SupportedStyles: with_first_parameter, with_fixed_indentation
|
|
96
|
+
Style/AlignParameters:
|
|
97
|
+
Exclude:
|
|
98
|
+
- 'lib/capistrano/datadog.rb'
|
|
99
|
+
- 'lib/dogapi/event.rb'
|
|
100
|
+
|
|
101
|
+
# Offense count: 6
|
|
102
|
+
# Cop supports --auto-correct.
|
|
103
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
104
|
+
# SupportedStyles: always, conditionals
|
|
105
|
+
Style/AndOr:
|
|
106
|
+
Exclude:
|
|
107
|
+
- 'lib/capistrano/datadog.rb'
|
|
108
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
109
|
+
- 'lib/dogapi/facade.rb'
|
|
110
|
+
- 'lib/dogapi/v1/dash.rb'
|
|
111
|
+
|
|
112
|
+
# Offense count: 1
|
|
113
|
+
# Cop supports --auto-correct.
|
|
114
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
115
|
+
# SupportedStyles: braces, no_braces, context_dependent
|
|
116
|
+
Style/BracesAroundHashParameters:
|
|
117
|
+
Exclude:
|
|
118
|
+
- 'lib/dogapi/v1/event.rb'
|
|
119
|
+
|
|
120
|
+
# Offense count: 2
|
|
121
|
+
# Cop supports --auto-correct.
|
|
122
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
123
|
+
# SupportedStyles: is_a?, kind_of?
|
|
124
|
+
Style/ClassCheck:
|
|
125
|
+
Exclude:
|
|
126
|
+
- 'lib/dogapi/facade.rb'
|
|
127
|
+
- 'lib/dogapi/v1/event.rb'
|
|
128
|
+
|
|
129
|
+
# Offense count: 2
|
|
130
|
+
# Cop supports --auto-correct.
|
|
131
|
+
Style/ClassMethods:
|
|
132
|
+
Exclude:
|
|
133
|
+
- 'lib/dogapi/common.rb'
|
|
134
|
+
|
|
135
|
+
# Offense count: 2
|
|
136
|
+
Style/ClassVars:
|
|
137
|
+
Exclude:
|
|
138
|
+
- 'lib/dogapi/common.rb'
|
|
139
|
+
|
|
140
|
+
# Offense count: 3
|
|
141
|
+
# Cop supports --auto-correct.
|
|
142
|
+
Style/ClosingParenthesisIndentation:
|
|
143
|
+
Exclude:
|
|
144
|
+
- 'lib/capistrano/datadog.rb'
|
|
145
|
+
|
|
146
|
+
# Offense count: 3
|
|
147
|
+
# Cop supports --auto-correct.
|
|
148
|
+
Style/ColonMethodCall:
|
|
149
|
+
Exclude:
|
|
150
|
+
- 'lib/capistrano/datadog.rb'
|
|
151
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
152
|
+
|
|
153
|
+
# Offense count: 2
|
|
154
|
+
# Cop supports --auto-correct.
|
|
155
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerBackticks.
|
|
156
|
+
# SupportedStyles: backticks, percent_x, mixed
|
|
157
|
+
Style/CommandLiteral:
|
|
158
|
+
Exclude:
|
|
159
|
+
- 'lib/capistrano/datadog.rb'
|
|
160
|
+
- 'lib/dogapi/common.rb'
|
|
161
|
+
|
|
162
|
+
# Offense count: 1
|
|
163
|
+
# Cop supports --auto-correct.
|
|
164
|
+
Style/CommentIndentation:
|
|
165
|
+
Exclude:
|
|
166
|
+
- 'lib/dogapi/event.rb'
|
|
167
|
+
|
|
168
|
+
# Offense count: 1
|
|
169
|
+
# Cop supports --auto-correct.
|
|
170
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
|
|
171
|
+
# SupportedStyles: assign_to_condition, assign_inside_condition
|
|
172
|
+
Style/ConditionalAssignment:
|
|
173
|
+
Exclude:
|
|
174
|
+
- 'lib/capistrano/datadog.rb'
|
|
175
|
+
|
|
176
|
+
# Offense count: 18
|
|
177
|
+
# Cop supports --auto-correct.
|
|
178
|
+
Style/DefWithParentheses:
|
|
179
|
+
Exclude:
|
|
180
|
+
- 'lib/capistrano/datadog.rb'
|
|
181
|
+
- 'lib/dogapi/facade.rb'
|
|
182
|
+
- 'lib/dogapi/v1/embed.rb'
|
|
183
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
184
|
+
- 'lib/dogapi/v1/screenboard.rb'
|
|
185
|
+
|
|
186
|
+
# Offense count: 21
|
|
187
|
+
Style/Documentation:
|
|
188
|
+
Exclude:
|
|
189
|
+
- 'spec/**/*'
|
|
190
|
+
- 'test/**/*'
|
|
191
|
+
- 'lib/capistrano/datadog.rb'
|
|
192
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
193
|
+
- 'lib/capistrano/datadog/v3.rb'
|
|
194
|
+
- 'lib/dogapi/common.rb'
|
|
195
|
+
- 'lib/dogapi/v1/alert.rb'
|
|
196
|
+
- 'lib/dogapi/v1/comment.rb'
|
|
197
|
+
- 'lib/dogapi/v1/dash.rb'
|
|
198
|
+
- 'lib/dogapi/v1/metadata.rb'
|
|
199
|
+
- 'lib/dogapi/v1/monitor.rb'
|
|
200
|
+
- 'lib/dogapi/v1/screenboard.rb'
|
|
201
|
+
- 'lib/dogapi/v1/search.rb'
|
|
202
|
+
- 'lib/dogapi/v1/service_check.rb'
|
|
203
|
+
- 'lib/dogapi/v1/snapshot.rb'
|
|
204
|
+
- 'lib/dogapi/v1/user.rb'
|
|
205
|
+
|
|
206
|
+
# Offense count: 3
|
|
207
|
+
# Cop supports --auto-correct.
|
|
208
|
+
Style/EmptyLines:
|
|
209
|
+
Exclude:
|
|
210
|
+
- 'Rakefile'
|
|
211
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
212
|
+
- 'lib/dogapi/facade.rb'
|
|
213
|
+
|
|
214
|
+
# Offense count: 56
|
|
215
|
+
# Cop supports --auto-correct.
|
|
216
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
217
|
+
# SupportedStyles: empty_lines, no_empty_lines
|
|
218
|
+
Style/EmptyLinesAroundClassBody:
|
|
219
|
+
Enabled: false
|
|
220
|
+
|
|
221
|
+
# Offense count: 1
|
|
222
|
+
# Cop supports --auto-correct.
|
|
223
|
+
Style/EmptyLinesAroundMethodBody:
|
|
224
|
+
Exclude:
|
|
225
|
+
- 'lib/dogapi/facade.rb'
|
|
226
|
+
|
|
227
|
+
# Offense count: 5
|
|
228
|
+
# Cop supports --auto-correct.
|
|
229
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
230
|
+
# SupportedStyles: empty_lines, no_empty_lines
|
|
231
|
+
Style/EmptyLinesAroundModuleBody:
|
|
232
|
+
Exclude:
|
|
233
|
+
- 'lib/capistrano/datadog.rb'
|
|
234
|
+
- 'lib/dogapi/common.rb'
|
|
235
|
+
- 'lib/dogapi/event.rb'
|
|
236
|
+
- 'lib/dogapi/facade.rb'
|
|
237
|
+
- 'lib/dogapi/metric.rb'
|
|
238
|
+
|
|
239
|
+
# Offense count: 1
|
|
240
|
+
# Cop supports --auto-correct.
|
|
241
|
+
Style/EmptyLiteral:
|
|
242
|
+
Exclude:
|
|
243
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
244
|
+
|
|
245
|
+
# Offense count: 1
|
|
246
|
+
# Cop supports --auto-correct.
|
|
247
|
+
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
|
|
248
|
+
Style/ExtraSpacing:
|
|
249
|
+
Exclude:
|
|
250
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
251
|
+
|
|
252
|
+
# Offense count: 2
|
|
253
|
+
# Configuration parameters: MinBodyLength.
|
|
254
|
+
Style/GuardClause:
|
|
255
|
+
Exclude:
|
|
256
|
+
- 'lib/capistrano/datadog.rb'
|
|
257
|
+
- 'lib/dogapi/facade.rb'
|
|
258
|
+
|
|
259
|
+
# Offense count: 86
|
|
260
|
+
# Cop supports --auto-correct.
|
|
261
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
|
262
|
+
# SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
|
|
263
|
+
Style/HashSyntax:
|
|
264
|
+
Exclude:
|
|
265
|
+
- 'lib/capistrano/datadog.rb'
|
|
266
|
+
- 'lib/dogapi/event.rb'
|
|
267
|
+
- 'lib/dogapi/facade.rb'
|
|
268
|
+
- 'lib/dogapi/metric.rb'
|
|
269
|
+
- 'lib/dogapi/v1/dash.rb'
|
|
270
|
+
- 'lib/dogapi/v1/embed.rb'
|
|
271
|
+
- 'lib/dogapi/v1/event.rb'
|
|
272
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
273
|
+
- 'lib/dogapi/v1/search.rb'
|
|
274
|
+
- 'lib/dogapi/v1/snapshot.rb'
|
|
275
|
+
- 'lib/dogapi/v1/tag.rb'
|
|
276
|
+
|
|
277
|
+
# Offense count: 15
|
|
278
|
+
# Cop supports --auto-correct.
|
|
279
|
+
# Configuration parameters: MaxLineLength.
|
|
280
|
+
Style/IfUnlessModifier:
|
|
281
|
+
Exclude:
|
|
282
|
+
- 'lib/capistrano/datadog.rb'
|
|
283
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
284
|
+
- 'lib/capistrano/datadog/v3.rb'
|
|
285
|
+
- 'lib/dogapi/common.rb'
|
|
286
|
+
- 'lib/dogapi/event.rb'
|
|
287
|
+
- 'lib/dogapi/v1/event.rb'
|
|
288
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
289
|
+
- 'lib/dogapi/v1/tag.rb'
|
|
290
|
+
|
|
291
|
+
# Offense count: 2
|
|
292
|
+
# Cop supports --auto-correct.
|
|
293
|
+
# Configuration parameters: SupportedStyles, IndentationWidth.
|
|
294
|
+
# SupportedStyles: special_inside_parentheses, consistent, align_braces
|
|
295
|
+
Style/IndentHash:
|
|
296
|
+
EnforcedStyle: consistent
|
|
297
|
+
|
|
298
|
+
# Offense count: 1
|
|
299
|
+
# Cop supports --auto-correct.
|
|
300
|
+
# Configuration parameters: Width.
|
|
301
|
+
Style/IndentationWidth:
|
|
302
|
+
Exclude:
|
|
303
|
+
- 'lib/capistrano/datadog.rb'
|
|
304
|
+
|
|
305
|
+
# Offense count: 13
|
|
306
|
+
# Cop supports --auto-correct.
|
|
307
|
+
Style/MethodCallParentheses:
|
|
308
|
+
Exclude:
|
|
309
|
+
- 'lib/dogapi/common.rb'
|
|
310
|
+
- 'lib/dogapi/event.rb'
|
|
311
|
+
- 'lib/dogapi/facade.rb'
|
|
312
|
+
- 'lib/dogapi/v1/event.rb'
|
|
313
|
+
|
|
314
|
+
# Offense count: 5
|
|
315
|
+
# Cop supports --auto-correct.
|
|
316
|
+
Style/MultilineIfThen:
|
|
317
|
+
Exclude:
|
|
318
|
+
- 'lib/capistrano/datadog.rb'
|
|
319
|
+
|
|
320
|
+
# Offense count: 3
|
|
321
|
+
# Cop supports --auto-correct.
|
|
322
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
323
|
+
# SupportedStyles: symmetrical, new_line, same_line
|
|
324
|
+
Style/MultilineMethodCallBraceLayout:
|
|
325
|
+
Exclude:
|
|
326
|
+
- 'lib/capistrano/datadog.rb'
|
|
327
|
+
|
|
328
|
+
# Offense count: 17
|
|
329
|
+
# Cop supports --auto-correct.
|
|
330
|
+
Style/MutableConstant:
|
|
331
|
+
Enabled: false
|
|
332
|
+
|
|
333
|
+
# Offense count: 2
|
|
334
|
+
# Cop supports --auto-correct.
|
|
335
|
+
Style/NegatedIf:
|
|
336
|
+
Exclude:
|
|
337
|
+
- 'lib/dogapi/common.rb'
|
|
338
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
339
|
+
|
|
340
|
+
# Offense count: 1
|
|
341
|
+
# Cop supports --auto-correct.
|
|
342
|
+
Style/Not:
|
|
343
|
+
Exclude:
|
|
344
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
345
|
+
|
|
346
|
+
# Offense count: 2
|
|
347
|
+
# Cop supports --auto-correct.
|
|
348
|
+
# Configuration parameters: PreferredDelimiters.
|
|
349
|
+
Style/PercentLiteralDelimiters:
|
|
350
|
+
Exclude:
|
|
351
|
+
- 'lib/capistrano/datadog.rb'
|
|
352
|
+
- 'lib/dogapi/common.rb'
|
|
353
|
+
|
|
354
|
+
# Offense count: 2
|
|
355
|
+
# Cop supports --auto-correct.
|
|
356
|
+
Style/PreferredHashMethods:
|
|
357
|
+
Exclude:
|
|
358
|
+
- 'lib/dogapi/common.rb'
|
|
359
|
+
|
|
360
|
+
# Offense count: 3
|
|
361
|
+
# Cop supports --auto-correct.
|
|
362
|
+
Style/RedundantBegin:
|
|
363
|
+
Exclude:
|
|
364
|
+
- 'lib/capistrano/datadog.rb'
|
|
365
|
+
- 'lib/dogapi/common.rb'
|
|
366
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
367
|
+
|
|
368
|
+
# Offense count: 2
|
|
369
|
+
# Cop supports --auto-correct.
|
|
370
|
+
# Configuration parameters: AllowMultipleReturnValues.
|
|
371
|
+
Style/RedundantReturn:
|
|
372
|
+
Exclude:
|
|
373
|
+
- 'lib/dogapi/common.rb'
|
|
374
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
375
|
+
|
|
376
|
+
# Offense count: 6
|
|
377
|
+
# Cop supports --auto-correct.
|
|
378
|
+
Style/RedundantSelf:
|
|
379
|
+
Exclude:
|
|
380
|
+
- 'lib/capistrano/datadog/v3.rb'
|
|
381
|
+
- 'lib/dogapi/facade.rb'
|
|
382
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
383
|
+
|
|
384
|
+
# Offense count: 2
|
|
385
|
+
# Cop supports --auto-correct.
|
|
386
|
+
Style/SelfAssignment:
|
|
387
|
+
Exclude:
|
|
388
|
+
- 'lib/dogapi/event.rb'
|
|
389
|
+
- 'lib/dogapi/v1/event.rb'
|
|
390
|
+
|
|
391
|
+
# Offense count: 75
|
|
392
|
+
# Cop supports --auto-correct.
|
|
393
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
394
|
+
# SupportedStyles: space, no_space
|
|
395
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
|
396
|
+
Exclude:
|
|
397
|
+
- 'lib/capistrano/datadog.rb'
|
|
398
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
399
|
+
- 'lib/dogapi/common.rb'
|
|
400
|
+
- 'lib/dogapi/event.rb'
|
|
401
|
+
- 'lib/dogapi/facade.rb'
|
|
402
|
+
- 'lib/dogapi/v1/dash.rb'
|
|
403
|
+
- 'lib/dogapi/v1/embed.rb'
|
|
404
|
+
- 'lib/dogapi/v1/event.rb'
|
|
405
|
+
- 'lib/dogapi/v1/metric.rb'
|
|
406
|
+
- 'lib/dogapi/v1/snapshot.rb'
|
|
407
|
+
- 'lib/dogapi/v1/tag.rb'
|
|
408
|
+
- 'lib/dogapi/v1/user.rb'
|
|
409
|
+
|
|
410
|
+
# Offense count: 2
|
|
411
|
+
# Cop supports --auto-correct.
|
|
412
|
+
# Configuration parameters: AllowForAlignment.
|
|
413
|
+
Style/SpaceAroundOperators:
|
|
414
|
+
Exclude:
|
|
415
|
+
- 'lib/dogapi/event.rb'
|
|
416
|
+
|
|
417
|
+
# Offense count: 1
|
|
418
|
+
# Cop supports --auto-correct.
|
|
419
|
+
# Configuration parameters: AllowForAlignment.
|
|
420
|
+
Style/SpaceBeforeFirstArg:
|
|
421
|
+
Exclude:
|
|
422
|
+
- 'lib/capistrano/datadog/v2.rb'
|
|
423
|
+
|
|
424
|
+
# Offense count: 21
|
|
425
|
+
# Cop supports --auto-correct.
|
|
426
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
|
|
427
|
+
# SupportedStyles: single_quotes, double_quotes
|
|
428
|
+
Style/StringLiterals:
|
|
429
|
+
Exclude:
|
|
430
|
+
- 'lib/dogapi/event.rb'
|
|
431
|
+
|
|
432
|
+
# Offense count: 10
|
|
433
|
+
# Cop supports --auto-correct.
|
|
434
|
+
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
|
|
435
|
+
# SupportedStyles: comma, consistent_comma, no_comma
|
|
436
|
+
Style/TrailingCommaInLiteral:
|
|
437
|
+
Exclude:
|
|
438
|
+
- 'lib/dogapi/event.rb'
|
|
439
|
+
- 'lib/dogapi/v1/alert.rb'
|
|
440
|
+
- 'lib/dogapi/v1/comment.rb'
|
|
441
|
+
- 'lib/dogapi/v1/embed.rb'
|
|
442
|
+
- 'lib/dogapi/v1/monitor.rb'
|
|
443
|
+
- 'lib/dogapi/v1/snapshot.rb'
|
|
444
|
+
- 'lib/dogapi/v1/user.rb'
|
|
445
|
+
|
|
446
|
+
# Offense count: 2
|
|
447
|
+
# Cop supports --auto-correct.
|
|
448
|
+
# Configuration parameters: SupportedStyles, WordRegex.
|
|
449
|
+
# SupportedStyles: percent, brackets
|
|
450
|
+
Style/WordArray:
|
|
451
|
+
EnforcedStyle: percent
|
|
452
|
+
MinSize: -Infinity
|
|
453
|
+
|
|
454
|
+
# Offense count: 1
|
|
455
|
+
# Cop supports --auto-correct.
|
|
456
|
+
Style/ZeroLengthPredicate:
|
|
457
|
+
Exclude:
|
|
458
|
+
- 'lib/capistrano/datadog.rb'
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
# 1.28.0 / 2017-08-16
|
|
5
|
+
|
|
6
|
+
* [FEATURE] Accept `group_states` strings for `get_monitor` function. See [#132][] (thanks [@acroos][])
|
|
7
|
+
* [FEATURE] Add cancel\_by\_scope endpoint. See [#133][] (thanks [@martinisoft][])
|
|
8
|
+
|
|
4
9
|
# 1.27.0 / 2017-05-01
|
|
5
10
|
|
|
6
11
|
* [FEATURE] Add monitor validation endpoint. See [#127][]
|
|
@@ -183,8 +188,11 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www
|
|
|
183
188
|
[#120]: https://github.com/DataDog/dogapi-rb/issues/120
|
|
184
189
|
[#125]: https://github.com/DataDog/dogapi-rb/issues/125
|
|
185
190
|
[#127]: https://github.com/DataDog/dogapi-rb/issues/127
|
|
191
|
+
[#132]: https://github.com/DataDog/dogapi-rb/issues/132
|
|
192
|
+
[#133]: https://github.com/DataDog/dogapi-rb/issues/133
|
|
186
193
|
[@ArjenSchwarz]: https://github.com/ArjenSchwarz
|
|
187
194
|
[@Kaixiang]: https://github.com/Kaixiang
|
|
195
|
+
[@acroos]: https://github.com/acroos
|
|
188
196
|
[@ansel1]: https://github.com/ansel1
|
|
189
197
|
[@arielo]: https://github.com/arielo
|
|
190
198
|
[@blakehilscher]: https://github.com/blakehilscher
|
|
@@ -192,6 +200,7 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www
|
|
|
192
200
|
[@casperisfine]: https://github.com/casperisfine
|
|
193
201
|
[@hnovikov]: https://github.com/hnovikov
|
|
194
202
|
[@jimmyngo]: https://github.com/jimmyngo
|
|
203
|
+
[@martinisoft]: https://github.com/martinisoft
|
|
195
204
|
[@miknight]: https://github.com/miknight
|
|
196
205
|
[@nots]: https://github.com/nots
|
|
197
206
|
[@rmoriz]: https://github.com/rmoriz
|
data/Gemfile
CHANGED
|
@@ -14,6 +14,7 @@ group :test do
|
|
|
14
14
|
gem 'term-ansicolor', '< 1.4'
|
|
15
15
|
gem 'webmock', '< 2.3'
|
|
16
16
|
gem 'nokogiri', '< 1.7'
|
|
17
|
+
gem 'tins', '~> 1.6.0'
|
|
17
18
|
elsif RbConfig::CONFIG['ruby_version'].start_with?("2.0")
|
|
18
19
|
gem 'nokogiri', '< 1.7'
|
|
19
20
|
gem 'webmock'
|
|
@@ -21,8 +22,3 @@ group :test do
|
|
|
21
22
|
gem 'webmock'
|
|
22
23
|
end
|
|
23
24
|
end
|
|
24
|
-
|
|
25
|
-
group :quality do
|
|
26
|
-
gem 'tailor'
|
|
27
|
-
gem 'tins', '~> 1.6.0'
|
|
28
|
-
end
|
data/Rakefile
CHANGED
|
@@ -4,22 +4,7 @@ require 'rdoc/task'
|
|
|
4
4
|
require 'rspec/core/rake_task'
|
|
5
5
|
require 'rubocop/rake_task'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if !RbConfig::CONFIG['ruby_version'].start_with?("2.3")
|
|
10
|
-
# Not compatible with Ruby 2.3.x
|
|
11
|
-
require 'tailor/rake_task'
|
|
12
|
-
default_tests.unshift(:tailor)
|
|
13
|
-
|
|
14
|
-
Tailor::RakeTask.new do |task|
|
|
15
|
-
task.file_set 'lib/**/*.rb', :code do |style|
|
|
16
|
-
style.max_line_length 160, :level => :warn
|
|
17
|
-
style.max_code_lines_in_method 40, :level => :warn
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
task :default => default_tests
|
|
7
|
+
task :default => [:spec, :rubocop]
|
|
23
8
|
|
|
24
9
|
# Doc stuff
|
|
25
10
|
RDoc::Task.new do |rd|
|
|
@@ -33,10 +18,9 @@ end
|
|
|
33
18
|
RSpec::Core::RakeTask.new(:spec)
|
|
34
19
|
|
|
35
20
|
RuboCop::RakeTask.new do |task|
|
|
36
|
-
task.patterns = ['spec']
|
|
21
|
+
task.patterns = ['spec', 'lib']
|
|
37
22
|
end
|
|
38
23
|
|
|
39
|
-
|
|
40
24
|
desc "Find notes in code"
|
|
41
25
|
task :notes do
|
|
42
26
|
puts `grep --exclude=Rakefile -r 'OPTIMIZE:\\|FIXME:\\|TODO:' .`
|
data/lib/capistrano/datadog.rb
CHANGED
|
@@ -108,7 +108,8 @@ module Capistrano
|
|
|
108
108
|
if !task[:application].nil? and !task[:application].empty? then
|
|
109
109
|
application = ' for ' + task[:application]
|
|
110
110
|
end
|
|
111
|
-
title =
|
|
111
|
+
title = "#{user}@#{hostname} ran #{name}#{application} on #{roles.join(', ')} "\
|
|
112
|
+
"with capistrano in #{task[:timing].round(2)} secs"
|
|
112
113
|
type = 'deploy'
|
|
113
114
|
alert_type = 'success'
|
|
114
115
|
source_type = 'capistrano'
|
data/lib/dogapi/facade.rb
CHANGED
|
@@ -7,8 +7,11 @@ module Dogapi
|
|
|
7
7
|
#
|
|
8
8
|
# See Dogapi::V1 for the thick underlying clients
|
|
9
9
|
#
|
|
10
|
-
# Class methods return a tuple of (+response_code+, +response_body+). Unless
|
|
11
|
-
|
|
10
|
+
# Class methods return a tuple of (+response_code+, +response_body+). Unless
|
|
11
|
+
# otherwise noted, the response body is deserialized JSON. Up-to-date
|
|
12
|
+
# information about the JSON object structure is available in the HTTP API
|
|
13
|
+
# documentation, here[https://github.com/DataDog/dogapi/wiki].
|
|
14
|
+
class Client # rubocop:disable Metrics/ClassLength
|
|
12
15
|
|
|
13
16
|
def initialize(api_key, application_key=nil, host=nil, device=nil, silent=true, timeout=nil, endpoint=nil)
|
|
14
17
|
|
|
@@ -448,6 +451,10 @@ module Dogapi
|
|
|
448
451
|
@monitor_svc.cancel_downtime(downtime_id)
|
|
449
452
|
end
|
|
450
453
|
|
|
454
|
+
def cancel_downtime_by_scope(scope)
|
|
455
|
+
@monitor_svc.cancel_downtime_by_scope(scope)
|
|
456
|
+
end
|
|
457
|
+
|
|
451
458
|
def get_all_downtimes(options= {})
|
|
452
459
|
@monitor_svc.get_all_downtimes(options)
|
|
453
460
|
end
|
data/lib/dogapi/v1/monitor.rb
CHANGED
|
@@ -29,7 +29,10 @@ module Dogapi
|
|
|
29
29
|
# :group_states is an optional list of statuses to filter returned
|
|
30
30
|
# groups. If no value is given then no group states will be returned.
|
|
31
31
|
# Possible values are: "all", "ok", "warn", "alert", "no data".
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
if extra_params[:group_states].respond_to?(:join)
|
|
34
|
+
extra_params[:group_states] = extra_params[:group_states].join(',')
|
|
35
|
+
end
|
|
33
36
|
|
|
34
37
|
request(Net::HTTP::Get, "/api/#{API_VERSION}/monitor/#{monitor_id}", extra_params, nil, false)
|
|
35
38
|
end
|
|
@@ -43,7 +46,9 @@ module Dogapi
|
|
|
43
46
|
# :group_states is an optional list of statuses to filter returned
|
|
44
47
|
# groups. If no value is given then no group states will be returned.
|
|
45
48
|
# Possible values are: "all", "ok", "warn", "alert", "no data".
|
|
46
|
-
|
|
49
|
+
if extra_params[:group_states].respond_to?(:join)
|
|
50
|
+
extra_params[:group_states] = extra_params[:group_states].join(',')
|
|
51
|
+
end
|
|
47
52
|
|
|
48
53
|
# :tags is an optional list of scope tags to filter the list of monitors
|
|
49
54
|
# returned. If no value is given, then all monitors, regardless of
|
|
@@ -101,6 +106,10 @@ module Dogapi
|
|
|
101
106
|
request(Net::HTTP::Delete, "/api/#{API_VERSION}/downtime/#{downtime_id}", nil, nil, false)
|
|
102
107
|
end
|
|
103
108
|
|
|
109
|
+
def cancel_downtime_by_scope(scope)
|
|
110
|
+
request(Net::HTTP::Post, "/api/#{API_VERSION}/downtime/cancel/by_scope", nil, { 'scope' => scope }, false)
|
|
111
|
+
end
|
|
112
|
+
|
|
104
113
|
def get_all_downtimes(options = {})
|
|
105
114
|
request(Net::HTTP::Get, "/api/#{API_VERSION}/downtime", options, nil, false)
|
|
106
115
|
end
|
data/lib/dogapi/v1/user.rb
CHANGED
|
@@ -10,7 +10,8 @@ module Dogapi
|
|
|
10
10
|
# <b>DEPRECATED:</b> Going forward, we're using a new and more restful API,
|
|
11
11
|
# the new methods are get_user, create_user, update_user, disable_user
|
|
12
12
|
def invite(emails, options= {})
|
|
13
|
-
warn '[DEPRECATION] Dogapi::V1::UserService::invite has been deprecated
|
|
13
|
+
warn '[DEPRECATION] Dogapi::V1::UserService::invite has been deprecated '\
|
|
14
|
+
'in favor of Dogapi::V1::UserService::create_user'
|
|
14
15
|
body = {
|
|
15
16
|
'emails' => emails,
|
|
16
17
|
}.merge options
|
data/lib/dogapi/version.rb
CHANGED
|
@@ -92,6 +92,12 @@ describe Dogapi::Client do
|
|
|
92
92
|
:delete, "/downtime/#{DOWNTIME_ID}"
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
+
describe '#cancel_downtime_by_scope' do
|
|
96
|
+
it_behaves_like 'an api method',
|
|
97
|
+
:cancel_downtime_by_scope, [DOWNTIME_SCOPE],
|
|
98
|
+
:post, '/downtime/cancel/by_scope'
|
|
99
|
+
end
|
|
100
|
+
|
|
95
101
|
describe '#get_all_downtimes' do
|
|
96
102
|
it_behaves_like 'an api method with optional params',
|
|
97
103
|
:get_all_downtimes, [],
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dogapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.28.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Datadog, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-08-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: multi_json
|
|
@@ -77,6 +77,7 @@ files:
|
|
|
77
77
|
- ".gitignore"
|
|
78
78
|
- ".rspec"
|
|
79
79
|
- ".rubocop.yml"
|
|
80
|
+
- ".rubocop_todo.yml"
|
|
80
81
|
- ".tailor"
|
|
81
82
|
- ".travis.yml"
|
|
82
83
|
- CHANGELOG.md
|
|
@@ -180,3 +181,4 @@ test_files:
|
|
|
180
181
|
- spec/spec_helper.rb
|
|
181
182
|
- spec/unit/common_spec.rb
|
|
182
183
|
- spec/unit/facade_spec.rb
|
|
184
|
+
has_rdoc: true
|