kennel 1.81.1 → 1.81.2
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/Readme.md +1 -1
- data/lib/kennel/models/dashboard.rb +18 -14
- data/lib/kennel/version.rb +1 -1
- data/template/Readme.md +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f9d3050dbb7a4e94cd22e64618142bedffd6fdfc5b5ee8e20b621b90f1d8f27
|
4
|
+
data.tar.gz: 640a86b74e46e27ec7f1b09dd555f0ba8f99e4fc1f687e5230bb00d12636ae1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80dbfff63550b6f5c3127cb8ecc97db6b3db38876469bcb9d50fce00a7e1b78e2f473dd3c3abaec081cb21037f53be72021d907c4285352b30dd3b6991f6c622
|
7
|
+
data.tar.gz: 02a3122ec70a951dc01f919c4d13877de88c6266048d006770a62adadd19587d74a603e8281699f878be0a20227a7086e37727c751cf5833e815fc795e3f9ee3
|
data/Readme.md
CHANGED
@@ -216,7 +216,7 @@ to unblock use the `validate: -> { false }` option.
|
|
216
216
|
|
217
217
|
Link resources with their kennel_id in the format `project kennel_id` + `:` + `resource kennel_id`,
|
218
218
|
this should be used to create dependent resources like monitor + slos,
|
219
|
-
so they can be created in a single update and can be re-created if any of them is deleted.
|
219
|
+
so they can be created in a single update and can be re-created if any of them is deleted.
|
220
220
|
|
221
221
|
|Resource|Type|Syntax|
|
222
222
|
|---|---|---|
|
@@ -186,22 +186,26 @@ module Kennel
|
|
186
186
|
end
|
187
187
|
|
188
188
|
def render_definitions(definitions)
|
189
|
-
definitions.map do |title, type, display_type, queries, options = {},
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
189
|
+
definitions.map do |title, type, display_type, queries, options = {}, too_many_args = nil|
|
190
|
+
if title.is_a?(Hash) && !type
|
191
|
+
title # user gave a full widget, just use it
|
192
|
+
else
|
193
|
+
# validate inputs
|
194
|
+
if too_many_args || (!title || !type || !queries || !options.is_a?(Hash))
|
195
|
+
raise ArgumentError, "Expected exactly 5 arguments for each definition (title, type, display_type, queries, options)"
|
196
|
+
end
|
197
|
+
if (SUPPORTED_DEFINITION_OPTIONS | options.keys) != SUPPORTED_DEFINITION_OPTIONS
|
198
|
+
raise ArgumentError, "Supported options are: #{SUPPORTED_DEFINITION_OPTIONS.map(&:inspect).join(", ")}"
|
199
|
+
end
|
197
200
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
201
|
+
# build definition
|
202
|
+
requests = Array(queries).map do |q|
|
203
|
+
request = { q: q }
|
204
|
+
request[:display_type] = display_type if display_type
|
205
|
+
request
|
206
|
+
end
|
207
|
+
{ definition: { title: title, type: type, requests: requests, **options } }
|
203
208
|
end
|
204
|
-
{ definition: { title: title, type: type, requests: requests, **options } }
|
205
209
|
end
|
206
210
|
end
|
207
211
|
end
|
data/lib/kennel/version.rb
CHANGED
data/template/Readme.md
CHANGED
@@ -194,10 +194,11 @@ removing the `id` will cause kennel to create a new resource in datadog.
|
|
194
194
|
Some validations might be too strict for your usecase or just wrong, please [open an issue](https://github.com/grosser/kennel/issues) and
|
195
195
|
to unblock use the `validate: -> { false }` option.
|
196
196
|
|
197
|
-
### Linking with
|
197
|
+
### Linking resources with kennel_id
|
198
198
|
|
199
|
-
Link resources
|
200
|
-
this should be used to create dependent resources like monitor + slos
|
199
|
+
Link resources with their kennel_id in the format `project kennel_id` + `:` + `resource kennel_id`,
|
200
|
+
this should be used to create dependent resources like monitor + slos,
|
201
|
+
so they can be created in a single update and can be re-created if any of them is deleted.
|
201
202
|
|
202
203
|
|Resource|Type|Syntax|
|
203
204
|
|---|---|---|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kennel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.81.
|
4
|
+
version: 1.81.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|