dogapi 1.41.0 → 1.42.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/dogapi/v1/dashboard.rb +12 -0
- data/lib/dogapi/version.rb +1 -1
- data/spec/integration/dashboard_spec.rb +11 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c18772d3cb81c83a5fd80ed6eb50c21860414635d0219dfea836673e272c3e52
|
4
|
+
data.tar.gz: 2a98454037254f50ea58c828be224c0906d6eb1ae7fa0f817e6f2df75b55c984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82b3841b8ae9209a25b434194463b0a37f830004fc608a6eb29184fb3972791db94434a81ca7542b26166e903d80346b6e49fe49e80d55b18115451fc15837b4
|
7
|
+
data.tar.gz: 51a17532ec14faf58ea93448c390bdda914e12d8300e754998915cd3792b7a375a98cf6240478da357172ed8e77e9cf01ac52bf15eb2b0c64685e23d6cc191eb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 1.42.0 / 2020-09-17
|
4
|
+
|
5
|
+
* [Added] Allow dashboard creation / updates using Template Variable Presets. See [#238](https://github.com/DataDog/dogapi-rb/pull/238).
|
6
|
+
|
3
7
|
## 1.41.0 / 2020-07-27
|
4
8
|
|
5
9
|
* [Added] Improve user-agent header to include telemetry information. See [#235](https://github.com/DataDog/dogapi-rb/pull/235).
|
data/lib/dogapi/v1/dashboard.rb
CHANGED
@@ -28,6 +28,11 @@ module Dogapi
|
|
28
28
|
# e.g. '["user1@domain.com", "user2@domain.com"]'
|
29
29
|
# :template_variables => JSON: List of template variables for this dashboard.
|
30
30
|
# e.g. [{"name": "host", "prefix": "host", "default": "my-host"}]
|
31
|
+
# :template_variable_presets => JSON: List of template variables saved views
|
32
|
+
# e.g. {
|
33
|
+
# "name": "my_template_variable_preset",
|
34
|
+
# "template_variables": [{"name": "host", "prefix": "host", "default": "my-host"}]
|
35
|
+
# }
|
31
36
|
def create_board(title, widgets, layout_type, options)
|
32
37
|
# Required arguments
|
33
38
|
body = {
|
@@ -40,6 +45,7 @@ module Dogapi
|
|
40
45
|
body[:is_read_only] = options[:is_read_only] if options[:is_read_only]
|
41
46
|
body[:notify_list] = options[:notify_list] if options[:notify_list]
|
42
47
|
body[:template_variables] = options[:template_variables] if options[:template_variables]
|
48
|
+
body[:template_variable_presets] = options[:template_variable_presets] if options[:template_variable_presets]
|
43
49
|
|
44
50
|
request(Net::HTTP::Post, "/api/#{API_VERSION}/#{RESOURCE_NAME}", nil, body, true)
|
45
51
|
end
|
@@ -60,6 +66,11 @@ module Dogapi
|
|
60
66
|
# e.g. '["user1@domain.com", "user2@domain.com"]'
|
61
67
|
# :template_variables => JSON: List of template variables for this dashboard.
|
62
68
|
# e.g. [{"name": "host", "prefix": "host", "default": "my-host"}]
|
69
|
+
# :template_variable_presets => JSON: List of template variables saved views
|
70
|
+
# e.g. {
|
71
|
+
# "name": "my_template_variable_preset",
|
72
|
+
# "template_variables": [{"name": "host", "prefix": "host", "default": "my-host"}]
|
73
|
+
# }
|
63
74
|
def update_board(dashboard_id, title, widgets, layout_type, options)
|
64
75
|
# Required arguments
|
65
76
|
body = {
|
@@ -72,6 +83,7 @@ module Dogapi
|
|
72
83
|
body[:is_read_only] = options[:is_read_only] if options[:is_read_only]
|
73
84
|
body[:notify_list] = options[:notify_list] if options[:notify_list]
|
74
85
|
body[:template_variables] = options[:template_variables] if options[:template_variables]
|
86
|
+
body[:template_variable_presets] = options[:template_variable_presets] if options[:template_variable_presets]
|
75
87
|
|
76
88
|
request(Net::HTTP::Put, "/api/#{API_VERSION}/#{RESOURCE_NAME}/#{dashboard_id}", nil, body, true)
|
77
89
|
end
|
data/lib/dogapi/version.rb
CHANGED
@@ -26,6 +26,15 @@ describe Dogapi::Client do
|
|
26
26
|
'prefix' => 'host',
|
27
27
|
'default' => 'my-host'
|
28
28
|
}].freeze
|
29
|
+
TEMPLATE_VARIABLE_PRESETS = [{
|
30
|
+
'name' => 'preset1',
|
31
|
+
'template_variables' => [
|
32
|
+
{
|
33
|
+
'name' => 'host1',
|
34
|
+
'value' => 'my-host'
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}].freeze
|
29
38
|
|
30
39
|
REQUIRED_ARGS = {
|
31
40
|
title: TITLE,
|
@@ -37,7 +46,8 @@ describe Dogapi::Client do
|
|
37
46
|
description: DESCRIPTION,
|
38
47
|
is_read_only: IS_READ_ONLY,
|
39
48
|
notify_list: NOTIFY_LIST,
|
40
|
-
template_variables: TEMPLATE_VARIABLES
|
49
|
+
template_variables: TEMPLATE_VARIABLES,
|
50
|
+
template_variable_presets: TEMPLATE_VARIABLE_PRESETS
|
41
51
|
}
|
42
52
|
DASHBOARD_ARGS = REQUIRED_ARGS.values + [OPTIONS]
|
43
53
|
DASHBOARD_PAYLOAD = REQUIRED_ARGS.merge(OPTIONS)
|
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.42.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -177,7 +177,7 @@ metadata:
|
|
177
177
|
changelog_uri: https://github.com/DataDog/dogapi-rb/blob/master/CHANGELOG.md
|
178
178
|
documentation_uri: https://docs.datadoghq.com/api/
|
179
179
|
source_code_uri: https://github.com/DataDog/dogapi-rb
|
180
|
-
post_install_message:
|
180
|
+
post_install_message:
|
181
181
|
rdoc_options:
|
182
182
|
- "--title"
|
183
183
|
- DogAPI -- Datadog Client
|
@@ -198,8 +198,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
198
|
- !ruby/object:Gem::Version
|
199
199
|
version: '0'
|
200
200
|
requirements: []
|
201
|
-
rubygems_version: 3.
|
202
|
-
signing_key:
|
201
|
+
rubygems_version: 3.1.2
|
202
|
+
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: Ruby bindings for Datadog's API
|
205
205
|
test_files:
|