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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bedd02d8446f4dfce31b9a2b375da5376860490ea6122e3829db203c51f2120b
4
- data.tar.gz: 8378113bb0b466b3cf6b9e05622c1386691492e474d8c64f5fe8c742b60b32ba
3
+ metadata.gz: c18772d3cb81c83a5fd80ed6eb50c21860414635d0219dfea836673e272c3e52
4
+ data.tar.gz: 2a98454037254f50ea58c828be224c0906d6eb1ae7fa0f817e6f2df75b55c984
5
5
  SHA512:
6
- metadata.gz: 84dd004b3f9cc6e55f4523339690ee1e8688e45d53febeb10d472cbf510b5a42caf9caeb0a9f0e86721887aba0fa48adc694a7b67aa21da4984d3752001a1d81
7
- data.tar.gz: eb764eb19d7b150798e758487bf1457fc7d245cbbc9315d99b7616ea3eddf4d79d061e30cf423924aa6930cae9be98eb7ff88339ee11a3cb959f9c78f8dd6eec
6
+ metadata.gz: 82b3841b8ae9209a25b434194463b0a37f830004fc608a6eb29184fb3972791db94434a81ca7542b26166e903d80346b6e49fe49e80d55b18115451fc15837b4
7
+ data.tar.gz: 51a17532ec14faf58ea93448c390bdda914e12d8300e754998915cd3792b7a375a98cf6240478da357172ed8e77e9cf01ac52bf15eb2b0c64685e23d6cc191eb
@@ -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).
@@ -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
@@ -3,5 +3,5 @@
3
3
  # Copyright 2011-Present Datadog, Inc.
4
4
 
5
5
  module Dogapi
6
- VERSION = '1.41.0'
6
+ VERSION = '1.42.0'
7
7
  end
@@ -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.41.0
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-07-27 00:00:00.000000000 Z
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.0.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: