dogapi 1.37.1 → 1.42.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/.azure-pipelines/all.yml +16 -7
- data/.github/CODEOWNERS +10 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +36 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +77 -0
- data/.github/labeler.yml +5 -0
- data/.github/workflows/labeler.yml +11 -0
- data/.github/workflows/stale.yml +39 -0
- data/.rubocop_todo.yml +51 -71
- data/CHANGELOG.md +37 -0
- data/CONTRIBUTING.md +111 -0
- data/DEVELOPMENT.md +11 -0
- data/Gemfile +2 -0
- data/Gemfile_1.9 +13 -0
- data/LICENSE +21 -20
- data/LICENSE-3rdparty.csv +6 -0
- data/README.rdoc +14 -0
- data/RELEASING.md +46 -0
- data/SUPPORT.md +9 -0
- data/dogapi.gemspec +2 -0
- data/examples/custom_metric.rb +1 -1
- data/lib/capistrano/README.md +4 -1
- data/lib/capistrano/datadog.rb +8 -4
- data/lib/capistrano/datadog/v2.rb +9 -1
- data/lib/capistrano/datadog/v3.rb +10 -1
- data/lib/dogapi.rb +4 -0
- data/lib/dogapi/common.rb +90 -35
- data/lib/dogapi/event.rb +4 -0
- data/lib/dogapi/facade.rb +212 -10
- data/lib/dogapi/metric.rb +4 -0
- data/lib/dogapi/v1.rb +10 -0
- data/lib/dogapi/v1/alert.rb +4 -0
- data/lib/dogapi/v1/aws_integration.rb +117 -0
- data/lib/dogapi/v1/aws_logs.rb +107 -0
- data/lib/dogapi/v1/azure_integration.rb +85 -0
- data/lib/dogapi/v1/comment.rb +4 -0
- data/lib/dogapi/v1/dash.rb +10 -4
- data/lib/dogapi/v1/dashboard.rb +16 -0
- data/lib/dogapi/v1/dashboard_list.rb +4 -0
- data/lib/dogapi/v1/embed.rb +4 -0
- data/lib/dogapi/v1/event.rb +4 -0
- data/lib/dogapi/v1/gcp_integration.rb +76 -0
- data/lib/dogapi/v1/hosts.rb +4 -0
- data/lib/dogapi/v1/integration.rb +4 -0
- data/lib/dogapi/v1/metadata.rb +4 -0
- data/lib/dogapi/v1/metric.rb +4 -0
- data/lib/dogapi/v1/monitor.rb +20 -7
- data/lib/dogapi/v1/screenboard.rb +4 -0
- data/lib/dogapi/v1/search.rb +4 -0
- data/lib/dogapi/v1/service_check.rb +4 -0
- data/lib/dogapi/v1/service_level_objective.rb +113 -0
- data/lib/dogapi/v1/snapshot.rb +4 -0
- data/lib/dogapi/v1/synthetics.rb +80 -0
- data/lib/dogapi/v1/tag.rb +4 -0
- data/lib/dogapi/v1/usage.rb +4 -0
- data/lib/dogapi/v1/user.rb +4 -0
- data/lib/dogapi/v2.rb +4 -0
- data/lib/dogapi/v2/dashboard_list.rb +4 -0
- data/lib/dogapi/version.rb +5 -1
- data/spec/integration/alert_spec.rb +4 -0
- data/spec/integration/aws_integration_spec.rb +55 -0
- data/spec/integration/aws_logs_spec.rb +59 -0
- data/spec/integration/azure_integration_spec.rb +63 -0
- data/spec/integration/comment_spec.rb +5 -0
- data/spec/integration/common_spec.rb +4 -0
- data/spec/integration/dash_spec.rb +7 -1
- data/spec/integration/dashboard_list_spec.rb +4 -0
- data/spec/integration/dashboard_spec.rb +15 -1
- data/spec/integration/embed_spec.rb +4 -0
- data/spec/integration/event_spec.rb +5 -0
- data/spec/integration/gcp_integration_spec.rb +57 -0
- data/spec/integration/integration_spec.rb +4 -0
- data/spec/integration/metadata_spec.rb +4 -0
- data/spec/integration/metric_spec.rb +4 -0
- data/spec/integration/monitor_spec.rb +30 -1
- data/spec/integration/screenboard_spec.rb +4 -0
- data/spec/integration/search_spec.rb +4 -0
- data/spec/integration/service_check_spec.rb +4 -0
- data/spec/integration/service_level_objective_spec.rb +73 -0
- data/spec/integration/snapshot_spec.rb +4 -0
- data/spec/integration/synthetics_spec.rb +131 -0
- data/spec/integration/tag_spec.rb +4 -0
- data/spec/integration/usage_spec.rb +4 -0
- data/spec/integration/user_spec.rb +4 -0
- data/spec/spec_helper.rb +21 -0
- data/spec/unit/capistrano_spec.rb +4 -0
- data/spec/unit/common_spec.rb +64 -7
- data/spec/unit/facade_spec.rb +4 -0
- metadata +37 -7
data/lib/dogapi.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License.
|
2
|
+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
|
3
|
+
# Copyright 2011-Present Datadog, Inc.
|
4
|
+
|
1
5
|
require 'dogapi/common'
|
2
6
|
require 'dogapi/facade'
|
3
7
|
require 'dogapi/event'
|
data/lib/dogapi/common.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
+
# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License.
|
2
|
+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
|
3
|
+
# Copyright 2011-Present Datadog, Inc.
|
4
|
+
|
1
5
|
require 'cgi'
|
2
6
|
require 'net/https'
|
7
|
+
require 'rbconfig'
|
3
8
|
require 'socket'
|
4
9
|
require 'uri'
|
5
10
|
require 'English'
|
@@ -7,8 +12,18 @@ require 'English'
|
|
7
12
|
require 'rubygems'
|
8
13
|
require 'multi_json'
|
9
14
|
require 'set'
|
15
|
+
require 'open3'
|
16
|
+
|
17
|
+
require 'dogapi/version'
|
10
18
|
|
11
19
|
module Dogapi
|
20
|
+
USER_AGENT = format(
|
21
|
+
'dogapi-rb/%<version>s (ruby %<ruver>s; os %<os>s; arch %<arch>s)',
|
22
|
+
version: VERSION,
|
23
|
+
ruver: RUBY_VERSION,
|
24
|
+
os: RbConfig::CONFIG['host_os'].downcase,
|
25
|
+
arch: RbConfig::CONFIG['host_cpu']
|
26
|
+
)
|
12
27
|
|
13
28
|
# Metadata class to hold the scope of an API call
|
14
29
|
class Scope
|
@@ -83,13 +98,12 @@ module Dogapi
|
|
83
98
|
def connect
|
84
99
|
connection = Net::HTTP
|
85
100
|
|
86
|
-
#
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
end
|
101
|
+
# Expose using a proxy without setting the HTTPS_PROXY or HTTP_PROXY variables
|
102
|
+
proxy = Dogapi.find_proxy()
|
103
|
+
|
104
|
+
if proxy
|
105
|
+
proxy_uri = URI.parse(proxy)
|
106
|
+
connection = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port, proxy_uri.user, proxy_uri.password)
|
93
107
|
end
|
94
108
|
|
95
109
|
uri = URI.parse(@api_host)
|
@@ -118,17 +132,12 @@ module Dogapi
|
|
118
132
|
resp = nil
|
119
133
|
connect do |conn|
|
120
134
|
begin
|
121
|
-
|
122
|
-
req = method
|
123
|
-
req['DD-API-KEY'] = @api_key
|
124
|
-
req['DD-APPLICATION-KEY'] = @application_key if with_app_key
|
125
|
-
|
126
|
-
if send_json
|
127
|
-
req.content_type = 'application/json'
|
128
|
-
req.body = MultiJson.dump(body)
|
129
|
-
end
|
130
|
-
|
135
|
+
params = prepare_params(extra_params, url, with_app_key)
|
136
|
+
req = prepare_request(method, url, params, body, send_json, with_app_key)
|
131
137
|
resp = conn.request(req)
|
138
|
+
if resp.code.to_i / 100 == 3
|
139
|
+
resp = handle_redirect(conn, req, resp)
|
140
|
+
end
|
132
141
|
return handle_response(resp)
|
133
142
|
rescue Exception => e
|
134
143
|
suppress_error_if_silent e
|
@@ -136,29 +145,37 @@ module Dogapi
|
|
136
145
|
end
|
137
146
|
end
|
138
147
|
|
139
|
-
def
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
148
|
+
def prepare_request(method, url, params, body, send_json, with_app_key)
|
149
|
+
url_with_params = url + params
|
150
|
+
req = method.new(url_with_params)
|
151
|
+
req['User-Agent'] = USER_AGENT
|
152
|
+
unless should_set_api_and_app_keys_in_params?(url)
|
153
|
+
req['DD-API-KEY'] = @api_key
|
154
|
+
req['DD-APPLICATION-KEY'] = @application_key if with_app_key
|
155
|
+
end
|
156
|
+
if send_json
|
157
|
+
req.content_type = 'application/json'
|
158
|
+
req.body = MultiJson.dump(body)
|
159
|
+
end
|
160
|
+
return req
|
145
161
|
end
|
146
162
|
|
147
|
-
def
|
148
|
-
|
149
|
-
'/api/v1/check_run',
|
150
|
-
'/api/v1/events',
|
151
|
-
'/api/v1/screen']
|
152
|
-
|
153
|
-
include_in_params = set_of_urls.include?(url)
|
154
|
-
|
155
|
-
if include_in_params
|
163
|
+
def prepare_params(extra_params, url, with_app_key)
|
164
|
+
if should_set_api_and_app_keys_in_params?(url)
|
156
165
|
params = { api_key: @api_key }
|
157
166
|
params[:application_key] = @application_key if with_app_key
|
158
167
|
else
|
159
168
|
params = {}
|
160
169
|
end
|
161
|
-
|
170
|
+
params = extra_params.merge params unless extra_params.nil?
|
171
|
+
qs_params = params.map { |k, v| CGI.escape(k.to_s) + '=' + CGI.escape(v.to_s) }
|
172
|
+
qs = '?' + qs_params.join('&')
|
173
|
+
qs
|
174
|
+
end
|
175
|
+
|
176
|
+
def should_set_api_and_app_keys_in_params?(url)
|
177
|
+
set_of_urls = Set.new ['/api/v1/series', '/api/v1/check_run', '/api/v1/events', '/api/v1/screen']
|
178
|
+
return set_of_urls.include?(url)
|
162
179
|
end
|
163
180
|
|
164
181
|
def handle_response(resp)
|
@@ -173,6 +190,15 @@ module Dogapi
|
|
173
190
|
raise 'Invalid JSON Response: ' + resp.body
|
174
191
|
end
|
175
192
|
end
|
193
|
+
|
194
|
+
def handle_redirect(conn, req, resp, retries=10)
|
195
|
+
req.uri = URI.parse(resp.header['location'])
|
196
|
+
new_response = conn.request(req)
|
197
|
+
if retries > 1 && new_response.code / 100 == 3
|
198
|
+
new_response = handle_redirect(conn, req, new_response, retries - 1)
|
199
|
+
end
|
200
|
+
new_response
|
201
|
+
end
|
176
202
|
end
|
177
203
|
|
178
204
|
def Dogapi.find_datadog_host
|
@@ -184,9 +210,38 @@ module Dogapi
|
|
184
210
|
@@hostname = nil
|
185
211
|
|
186
212
|
def Dogapi.find_localhost
|
187
|
-
@@hostname
|
213
|
+
unless @@hostname
|
214
|
+
out, status = Open3.capture2('hostname', '-f', err: File::NULL)
|
215
|
+
# Get status to check if the call was successful
|
216
|
+
raise SystemCallError, 'Could not get hostname with `hostname -f`' unless status.exitstatus.zero?
|
217
|
+
@@hostname = out.strip
|
218
|
+
end
|
188
219
|
rescue SystemCallError
|
189
|
-
raise $ERROR_INFO unless $ERROR_INFO.class.name == 'Errno::ENOENT'
|
190
220
|
@@hostname = Addrinfo.getaddrinfo(Socket.gethostname, nil, nil, nil, nil, Socket::AI_CANONNAME).first.canonname
|
191
221
|
end
|
222
|
+
|
223
|
+
def Dogapi.find_proxy
|
224
|
+
ENV['DD_PROXY_HTTPS'] || ENV['dd_proxy_https'] ||
|
225
|
+
ENV['DD_PROXY_HTTP'] || ENV['dd_proxy_http'] ||
|
226
|
+
ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ENV['HTTP_PROXY'] || ENV['http_proxy']
|
227
|
+
end
|
228
|
+
|
229
|
+
def Dogapi.validate_tags(tags)
|
230
|
+
unless tags.is_a? Array
|
231
|
+
raise ArgumentError, "The tags parameter needs to be an array of string. Current value: #{tags}"
|
232
|
+
end
|
233
|
+
tags.each do |tag|
|
234
|
+
raise ArgumentError, "Each tag needs to be a string. Current value: #{tag}" unless tag.is_a? String
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
# Very simplified hash with indifferent access - access to string or symbol
|
239
|
+
# keys via symbols. E.g.:
|
240
|
+
# my_hash = { 'foo' => 1 }
|
241
|
+
# Dogapi.symbolized_access(my_hash)
|
242
|
+
# my_hash[:foo] # => 1
|
243
|
+
def Dogapi.symbolized_access(hash)
|
244
|
+
hash.default_proc = proc { |h, k| h.key?(k.to_s) ? h[k.to_s] : nil }
|
245
|
+
hash
|
246
|
+
end
|
192
247
|
end
|
data/lib/dogapi/event.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License.
|
2
|
+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
|
3
|
+
# Copyright 2011-Present Datadog, Inc.
|
4
|
+
|
1
5
|
require 'net/http'
|
2
6
|
|
3
7
|
require 'rubygems'
|
data/lib/dogapi/facade.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License.
|
2
|
+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
|
3
|
+
# Copyright 2011-Present Datadog, Inc.
|
4
|
+
|
1
5
|
require 'time'
|
2
6
|
require 'dogapi/v1'
|
3
7
|
require 'dogapi/v2'
|
@@ -59,6 +63,7 @@ module Dogapi
|
|
59
63
|
attr_accessor :v2
|
60
64
|
# Support for API version 2.
|
61
65
|
|
66
|
+
# rubocop:disable Metrics/MethodLength, Metrics/LineLength
|
62
67
|
def initialize(api_key, application_key=nil, host=nil, device=nil, silent=true, timeout=nil, endpoint=nil)
|
63
68
|
|
64
69
|
if api_key
|
@@ -89,17 +94,25 @@ module Dogapi
|
|
89
94
|
@embed_svc = Dogapi::V1::EmbedService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
90
95
|
@screenboard_svc = Dogapi::V1::ScreenboardService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
91
96
|
@monitor_svc = Dogapi::V1::MonitorService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
97
|
+
@synthetics_svc = Dogapi::V1::SyntheticsService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
92
98
|
@service_check_svc = Dogapi::V1::ServiceCheckService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
93
99
|
@metadata_svc = Dogapi::V1::MetadataService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
94
100
|
@legacy_event_svc = Dogapi::EventService.new(@datadog_host)
|
95
101
|
@hosts_svc = Dogapi::V1::HostsService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
96
102
|
@integration_svc = Dogapi::V1::IntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
103
|
+
@aws_integration_svc = Dogapi::V1::AwsIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
104
|
+
@aws_logs_svc = Dogapi::V1::AwsLogsService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
97
105
|
@usage_svc = Dogapi::V1::UsageService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
106
|
+
@azure_integration_svc = Dogapi::V1::AzureIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
107
|
+
@gcp_integration_svc = Dogapi::V1::GcpIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host)
|
108
|
+
@service_level_objective_svc = Dogapi::V1::ServiceLevelObjectiveService.new(@api_key, @application_key, silent,
|
109
|
+
timeout, @datadog_host)
|
98
110
|
|
99
111
|
# Support for Dashboard List API v2.
|
100
112
|
@v2 = Dogapi::ClientV2.new(@api_key, @application_key, true, true, @datadog_host)
|
101
113
|
|
102
114
|
end
|
115
|
+
# rubocop:enable Metrics/MethodLength, Metrics/LineLength
|
103
116
|
|
104
117
|
#
|
105
118
|
# METRICS
|
@@ -112,7 +125,7 @@ module Dogapi
|
|
112
125
|
# :device => String
|
113
126
|
# :options => Map
|
114
127
|
#
|
115
|
-
# options[:type] = "
|
128
|
+
# options[:type] = "count" to specify a counter metric
|
116
129
|
# options[:tags] = ["tag1", "tag2"] to tag the point
|
117
130
|
def emit_point(metric, value, options= {})
|
118
131
|
defaults = { :timestamp => Time.now }
|
@@ -134,7 +147,7 @@ module Dogapi
|
|
134
147
|
# :device => String
|
135
148
|
# :options => Map
|
136
149
|
#
|
137
|
-
# options[:type] = "
|
150
|
+
# options[:type] = "count" to specify a counter metric
|
138
151
|
# options[:tags] = ["tag1", "tag2"] to tag the point
|
139
152
|
def emit_points(metric, points, options= {})
|
140
153
|
scope = override_scope options
|
@@ -311,13 +324,13 @@ module Dogapi
|
|
311
324
|
#
|
312
325
|
|
313
326
|
# Create a dashboard.
|
314
|
-
def create_dashboard(title, description, graphs, template_variables=nil)
|
315
|
-
@dash_service.create_dashboard(title, description, graphs, template_variables)
|
327
|
+
def create_dashboard(title, description, graphs, template_variables = nil, read_only = false)
|
328
|
+
@dash_service.create_dashboard(title, description, graphs, template_variables, read_only)
|
316
329
|
end
|
317
330
|
|
318
331
|
# Update a dashboard.
|
319
|
-
def update_dashboard(dash_id, title, description, graphs, template_variables=nil)
|
320
|
-
@dash_service.update_dashboard(dash_id, title, description, graphs, template_variables)
|
332
|
+
def update_dashboard(dash_id, title, description, graphs, template_variables = nil, read_only = false)
|
333
|
+
@dash_service.update_dashboard(dash_id, title, description, graphs, template_variables, read_only)
|
321
334
|
end
|
322
335
|
|
323
336
|
# Fetch the given dashboard.
|
@@ -520,6 +533,49 @@ module Dogapi
|
|
520
533
|
@screenboard_svc.revoke_screenboard(board_id)
|
521
534
|
end
|
522
535
|
|
536
|
+
#
|
537
|
+
# SYNTHETICS
|
538
|
+
#
|
539
|
+
def create_synthetics_test(type, config, options = {})
|
540
|
+
@synthetics_svc.create_synthetics_test(type, config, options)
|
541
|
+
end
|
542
|
+
|
543
|
+
def update_synthetics_test(test_id, type, config, options = {})
|
544
|
+
@synthetics_svc.update_synthetics_test(test_id, type, config, options)
|
545
|
+
end
|
546
|
+
|
547
|
+
def delete_synthetics_tests(test_ids)
|
548
|
+
@synthetics_svc.delete_synthetics_tests(test_ids)
|
549
|
+
end
|
550
|
+
|
551
|
+
def start_pause_synthetics_test(test_id, new_status)
|
552
|
+
@synthetics_svc.start_pause_synthetics_test(test_id, new_status)
|
553
|
+
end
|
554
|
+
|
555
|
+
def get_all_synthetics_tests
|
556
|
+
@synthetics_svc.get_all_synthetics_tests()
|
557
|
+
end
|
558
|
+
|
559
|
+
def get_synthetics_test(test_id)
|
560
|
+
@synthetics_svc.get_synthetics_test(test_id)
|
561
|
+
end
|
562
|
+
|
563
|
+
def get_synthetics_results(test_id)
|
564
|
+
@synthetics_svc.get_synthetics_results(test_id)
|
565
|
+
end
|
566
|
+
|
567
|
+
def get_synthetics_result(test_id, result_id)
|
568
|
+
@synthetics_svc.get_synthetics_result(test_id, result_id)
|
569
|
+
end
|
570
|
+
|
571
|
+
def get_synthetics_devices
|
572
|
+
@synthetics_svc.get_synthetics_devices()
|
573
|
+
end
|
574
|
+
|
575
|
+
def get_synthetics_locations
|
576
|
+
@synthetics_svc.get_synthetics_locations()
|
577
|
+
end
|
578
|
+
|
523
579
|
#
|
524
580
|
# MONITORS
|
525
581
|
#
|
@@ -536,8 +592,12 @@ module Dogapi
|
|
536
592
|
@monitor_svc.get_monitor(monitor_id, options)
|
537
593
|
end
|
538
594
|
|
539
|
-
def
|
540
|
-
@monitor_svc.
|
595
|
+
def can_delete_monitors(monitor_ids)
|
596
|
+
@monitor_svc.can_delete_monitors(monitor_ids)
|
597
|
+
end
|
598
|
+
|
599
|
+
def delete_monitor(monitor_id, options = {})
|
600
|
+
@monitor_svc.delete_monitor(monitor_id, options)
|
541
601
|
end
|
542
602
|
|
543
603
|
def get_all_monitors(options= {})
|
@@ -588,8 +648,8 @@ module Dogapi
|
|
588
648
|
@monitor_svc.update_downtime(downtime_id, options)
|
589
649
|
end
|
590
650
|
|
591
|
-
def get_downtime(downtime_id)
|
592
|
-
@monitor_svc.get_downtime(downtime_id)
|
651
|
+
def get_downtime(downtime_id, options = {})
|
652
|
+
@monitor_svc.get_downtime(downtime_id, options)
|
593
653
|
end
|
594
654
|
|
595
655
|
def cancel_downtime(downtime_id)
|
@@ -616,6 +676,46 @@ module Dogapi
|
|
616
676
|
@monitor_svc.unmute_host(hostname)
|
617
677
|
end
|
618
678
|
|
679
|
+
#
|
680
|
+
# SERVICE LEVEL OBJECTIVES
|
681
|
+
#
|
682
|
+
|
683
|
+
def create_service_level_objective(type, slo_name, thresholds, options = {})
|
684
|
+
@service_level_objective_svc.create_service_level_objective(type, slo_name, thresholds, options)
|
685
|
+
end
|
686
|
+
|
687
|
+
def update_service_level_objective(slo_id, type, options = {})
|
688
|
+
@service_level_objective_svc.update_service_level_objective(slo_id, type, options)
|
689
|
+
end
|
690
|
+
|
691
|
+
def get_service_level_objective(slo_id)
|
692
|
+
@service_level_objective_svc.get_service_level_objective(slo_id)
|
693
|
+
end
|
694
|
+
|
695
|
+
def get_service_level_objective_history(slo_id, from_ts, to_ts)
|
696
|
+
@service_level_objective_svc.get_service_level_objective_history(slo_id, from_ts, to_ts)
|
697
|
+
end
|
698
|
+
|
699
|
+
def search_service_level_objective(slo_ids = nil, query = nil, offset = nil, limit = nil)
|
700
|
+
@service_level_objective_svc.search_service_level_objective(slo_ids, query, offset, limit)
|
701
|
+
end
|
702
|
+
|
703
|
+
def can_delete_service_level_objective(slo_ids)
|
704
|
+
@service_level_objective_svc.can_delete_service_level_objective(slo_ids)
|
705
|
+
end
|
706
|
+
|
707
|
+
def delete_service_level_objective(slo_id)
|
708
|
+
@service_level_objective_svc.delete_service_level_objective(slo_id)
|
709
|
+
end
|
710
|
+
|
711
|
+
def delete_many_service_level_objective(slo_ids)
|
712
|
+
@service_level_objective_svc.delete_many_service_level_objective(slo_ids)
|
713
|
+
end
|
714
|
+
|
715
|
+
def delete_timeframes_service_level_objective(ops)
|
716
|
+
@service_level_objective_svc.delete_timeframes_service_level_objective(ops)
|
717
|
+
end
|
718
|
+
|
619
719
|
#
|
620
720
|
# SERVICE CHECKS
|
621
721
|
#
|
@@ -682,6 +782,108 @@ module Dogapi
|
|
682
782
|
@integration_svc.delete_integration(source_type_name)
|
683
783
|
end
|
684
784
|
|
785
|
+
#
|
786
|
+
# AWS INTEGRATION
|
787
|
+
#
|
788
|
+
def aws_integration_list
|
789
|
+
@aws_integration_svc.aws_integration_list
|
790
|
+
end
|
791
|
+
|
792
|
+
def aws_integration_create(config)
|
793
|
+
@aws_integration_svc.aws_integration_create(config)
|
794
|
+
end
|
795
|
+
|
796
|
+
def aws_integration_delete(config)
|
797
|
+
@aws_integration_svc.aws_integration_delete(config)
|
798
|
+
end
|
799
|
+
|
800
|
+
def aws_integration_list_namespaces
|
801
|
+
@aws_integration_svc.aws_integration_list_namespaces
|
802
|
+
end
|
803
|
+
|
804
|
+
def aws_integration_generate_external_id(config)
|
805
|
+
@aws_integration_svc.aws_integration_generate_external_id(config)
|
806
|
+
end
|
807
|
+
|
808
|
+
def aws_integration_update(config, new_config)
|
809
|
+
@aws_integration_svc.aws_integration_update(config, new_config)
|
810
|
+
end
|
811
|
+
|
812
|
+
#
|
813
|
+
# AWS Logs Integration
|
814
|
+
#
|
815
|
+
|
816
|
+
def aws_logs_add_lambda(config)
|
817
|
+
@aws_logs_svc.aws_logs_add_lambda(config)
|
818
|
+
end
|
819
|
+
|
820
|
+
def aws_logs_list_services
|
821
|
+
@aws_logs_svc.aws_logs_list_services
|
822
|
+
end
|
823
|
+
|
824
|
+
def aws_logs_save_services(config)
|
825
|
+
@aws_logs_svc.aws_logs_save_services(config)
|
826
|
+
end
|
827
|
+
|
828
|
+
def aws_logs_integrations_list
|
829
|
+
@aws_logs_svc.aws_logs_integrations_list
|
830
|
+
end
|
831
|
+
|
832
|
+
def aws_logs_integration_delete(config)
|
833
|
+
@aws_logs_svc.aws_logs_integration_delete(config)
|
834
|
+
end
|
835
|
+
|
836
|
+
def aws_logs_check_lambda(config)
|
837
|
+
@aws_logs_svc.aws_logs_check_lambda(config)
|
838
|
+
end
|
839
|
+
|
840
|
+
def aws_logs_check_services(config)
|
841
|
+
@aws_logs_svc.aws_logs_check_services(config)
|
842
|
+
end
|
843
|
+
|
844
|
+
#
|
845
|
+
# AZURE INTEGRATION
|
846
|
+
#
|
847
|
+
|
848
|
+
def azure_integration_list
|
849
|
+
@azure_integration_svc.azure_integration_list
|
850
|
+
end
|
851
|
+
|
852
|
+
def azure_integration_create(config)
|
853
|
+
@azure_integration_svc.azure_integration_create(config)
|
854
|
+
end
|
855
|
+
|
856
|
+
def azure_integration_delete(config)
|
857
|
+
@azure_integration_svc.azure_integration_delete(config)
|
858
|
+
end
|
859
|
+
|
860
|
+
def azure_integration_update_host_filters(config)
|
861
|
+
@azure_integration_svc.azure_integration_update_host_filters(config)
|
862
|
+
end
|
863
|
+
|
864
|
+
def azure_integration_update(config)
|
865
|
+
@azure_integration_svc.azure_integration_update(config)
|
866
|
+
end
|
867
|
+
|
868
|
+
#
|
869
|
+
# GCP INTEGRATION
|
870
|
+
#
|
871
|
+
def gcp_integration_list
|
872
|
+
@gcp_integration_svc.gcp_integration_list
|
873
|
+
end
|
874
|
+
|
875
|
+
def gcp_integration_delete(config)
|
876
|
+
@gcp_integration_svc.gcp_integration_delete(config)
|
877
|
+
end
|
878
|
+
|
879
|
+
def gcp_integration_create(config)
|
880
|
+
@gcp_integration_svc.gcp_integration_create(config)
|
881
|
+
end
|
882
|
+
|
883
|
+
def gcp_integration_update(config)
|
884
|
+
@gcp_integration_svc.gcp_integration_update(config)
|
885
|
+
end
|
886
|
+
|
685
887
|
#
|
686
888
|
# USAGE
|
687
889
|
#
|