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/v1/embed.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'
|
2
6
|
|
3
7
|
module Dogapi
|
data/lib/dogapi/v1/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 'dogapi'
|
2
6
|
|
3
7
|
module Dogapi
|
@@ -0,0 +1,76 @@
|
|
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
|
+
|
5
|
+
require 'dogapi'
|
6
|
+
|
7
|
+
module Dogapi
|
8
|
+
class V1 # for namespacing
|
9
|
+
|
10
|
+
# GcpIntegrationService for user interaction with gcp configs.
|
11
|
+
class GcpIntegrationService < Dogapi::APIService
|
12
|
+
|
13
|
+
API_VERSION = 'v1'
|
14
|
+
|
15
|
+
# Retrieve gcp integration information
|
16
|
+
def gcp_integration_list
|
17
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/integration/gcp", nil, nil, false)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Delete an gcp integration
|
21
|
+
# :config => Hash: integration config.
|
22
|
+
# config = {
|
23
|
+
# :project_id => 'datadog-sandbox',
|
24
|
+
# :client_email => 'email@example.com'
|
25
|
+
# }
|
26
|
+
#
|
27
|
+
# dog = Dogapi::Client.new(api_key, app_key)
|
28
|
+
#
|
29
|
+
# puts dog.gcp_integration_delete(config)
|
30
|
+
def gcp_integration_delete(config)
|
31
|
+
request(Net::HTTP::Delete, "/api/#{API_VERSION}/integration/gcp", nil, config, true)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create an gcp integration
|
35
|
+
# :config => Hash: integration config.
|
36
|
+
# config = {
|
37
|
+
# :type => 'service_account',
|
38
|
+
# :project_id => '<PROJECT_ID>',
|
39
|
+
# :private_key_id => '<PRIVATE_KEY_ID>',
|
40
|
+
# :private_key => '<PRIVATE_KEY>',
|
41
|
+
# :client_email => '<CLIENT_EMAIL>',
|
42
|
+
# :client_id => '<CLIENT_ID>',
|
43
|
+
# :auth_uri => '<AUTH_URI>',
|
44
|
+
# :token_uri => '<TOKEN_URI>',
|
45
|
+
# :auth_provider_x509_cert_url => '<AUTH_PROVIDER_X509_CERT_URL>',
|
46
|
+
# :client_x509_cert_url => '<CLIENT_X509_CERT_URL>',
|
47
|
+
# :host_filters => '<KEY>:<VALUE>,<KEY>:<VALUE>,'
|
48
|
+
# }
|
49
|
+
#
|
50
|
+
# dog = Dogapi::Client.new(api_key, app_key)
|
51
|
+
#
|
52
|
+
# puts dog.gcp_integration_create(config)
|
53
|
+
def gcp_integration_create(config)
|
54
|
+
request(Net::HTTP::Post, "/api/#{API_VERSION}/integration/gcp", nil, config, true)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Update a configured gcp account.
|
58
|
+
# :config => Hash: integration config.
|
59
|
+
# config = {
|
60
|
+
# :project_id => '<PROJECT_ID>',
|
61
|
+
# :client_email => '<CLIENT_EMAIL>',
|
62
|
+
# :host_filters => '<KEY>:<VALUE>,<KEY>:<VALUE>,'
|
63
|
+
# :automute => true # takes a boolean and toggles GCE automuting
|
64
|
+
# }
|
65
|
+
#
|
66
|
+
# dog = Dogapi::Client.new(api_key, app_key)
|
67
|
+
#
|
68
|
+
# puts dog.gcp_integration_update(config)
|
69
|
+
def gcp_integration_update(config)
|
70
|
+
request(Net::HTTP::Put, "/api/#{API_VERSION}/integration/gcp", nil, config, true)
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
data/lib/dogapi/v1/hosts.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'
|
2
6
|
|
3
7
|
module Dogapi
|
@@ -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'
|
2
6
|
|
3
7
|
module Dogapi
|
data/lib/dogapi/v1/metadata.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'
|
2
6
|
|
3
7
|
module Dogapi
|
data/lib/dogapi/v1/metric.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'
|
2
6
|
|
3
7
|
module Dogapi
|
data/lib/dogapi/v1/monitor.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
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'
|
2
6
|
|
3
7
|
module Dogapi
|
4
8
|
class V1 # for namespacing
|
5
|
-
|
6
9
|
class MonitorService < Dogapi::APIService
|
7
|
-
|
8
10
|
API_VERSION = 'v1'
|
9
11
|
|
10
12
|
def monitor(type, query, options = {})
|
@@ -42,8 +44,19 @@ module Dogapi
|
|
42
44
|
request(Net::HTTP::Get, "/api/#{API_VERSION}/monitor/#{monitor_id}", extra_params, nil, false)
|
43
45
|
end
|
44
46
|
|
45
|
-
def
|
46
|
-
|
47
|
+
def can_delete_monitors(monitor_ids)
|
48
|
+
extra_params =
|
49
|
+
if monitor_ids.respond_to?(:join)
|
50
|
+
{ "monitor_ids" => monitor_ids.join(",") }
|
51
|
+
else
|
52
|
+
{ "monitor_ids" => monitor_ids }
|
53
|
+
end
|
54
|
+
|
55
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/monitor/can_delete", extra_params, nil, false)
|
56
|
+
end
|
57
|
+
|
58
|
+
def delete_monitor(monitor_id, options = {})
|
59
|
+
request(Net::HTTP::Delete, "/api/#{API_VERSION}/monitor/#{monitor_id}", options, nil, false)
|
47
60
|
end
|
48
61
|
|
49
62
|
def get_all_monitors(options = {})
|
@@ -122,8 +135,8 @@ module Dogapi
|
|
122
135
|
request(Net::HTTP::Put, "/api/#{API_VERSION}/downtime/#{downtime_id}", nil, options, true)
|
123
136
|
end
|
124
137
|
|
125
|
-
def get_downtime(downtime_id)
|
126
|
-
request(Net::HTTP::Get, "/api/#{API_VERSION}/downtime/#{downtime_id}",
|
138
|
+
def get_downtime(downtime_id, options = {})
|
139
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/downtime/#{downtime_id}", options, nil, false)
|
127
140
|
end
|
128
141
|
|
129
142
|
def cancel_downtime(downtime_id)
|
@@ -131,7 +144,7 @@ module Dogapi
|
|
131
144
|
end
|
132
145
|
|
133
146
|
def cancel_downtime_by_scope(scope)
|
134
|
-
request(Net::HTTP::Post, "/api/#{API_VERSION}/downtime/cancel/by_scope", nil, { 'scope' => scope },
|
147
|
+
request(Net::HTTP::Post, "/api/#{API_VERSION}/downtime/cancel/by_scope", nil, { 'scope' => scope }, true)
|
135
148
|
end
|
136
149
|
|
137
150
|
def get_all_downtimes(options = {})
|
@@ -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'
|
2
6
|
|
3
7
|
module Dogapi
|
data/lib/dogapi/v1/search.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'
|
2
6
|
|
3
7
|
module Dogapi
|
@@ -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'
|
2
6
|
|
3
7
|
module Dogapi
|
@@ -0,0 +1,113 @@
|
|
1
|
+
require 'dogapi'
|
2
|
+
|
3
|
+
module Dogapi
|
4
|
+
class V1 # for namespacing
|
5
|
+
|
6
|
+
# Implements Service Level Objectives endpoints
|
7
|
+
class ServiceLevelObjectiveService < Dogapi::APIService
|
8
|
+
|
9
|
+
API_VERSION = 'v1'
|
10
|
+
|
11
|
+
def create_service_level_objective(type, slo_name, thresholds, options = {})
|
12
|
+
body = {
|
13
|
+
type: type,
|
14
|
+
name: slo_name,
|
15
|
+
thresholds: thresholds
|
16
|
+
}
|
17
|
+
|
18
|
+
symbolized_options = Dogapi.symbolized_access(options)
|
19
|
+
if type.to_s == 'metric'
|
20
|
+
body[:query] = {
|
21
|
+
numerator: symbolized_options[:numerator],
|
22
|
+
denominator: symbolized_options[:denominator]
|
23
|
+
}
|
24
|
+
else
|
25
|
+
body[:monitor_search] = symbolized_options[:monitor_search] if symbolized_options[:monitor_search]
|
26
|
+
body[:monitor_ids] = symbolized_options[:monitor_ids] if symbolized_options[:monitor_ids]
|
27
|
+
body[:groups] = symbolized_options[:groups] if symbolized_options[:groups]
|
28
|
+
end
|
29
|
+
body[:tags] = symbolized_options[:tags] if symbolized_options[:tags]
|
30
|
+
body[:description] = symbolized_options[:description] if symbolized_options[:description]
|
31
|
+
|
32
|
+
request(Net::HTTP::Post, "/api/#{API_VERSION}/slo", nil, body, true)
|
33
|
+
end
|
34
|
+
|
35
|
+
def update_service_level_objective(slo_id, type, options = {})
|
36
|
+
body = {
|
37
|
+
type: type
|
38
|
+
}
|
39
|
+
|
40
|
+
symbolized_options = Dogapi.symbolized_access(options)
|
41
|
+
if type == 'metric'
|
42
|
+
if symbolized_options[:numerator] && symbolized_options[:denominator]
|
43
|
+
body[:query] = {
|
44
|
+
numerator: symbolized_options[:numerator],
|
45
|
+
denominator: symbolized_options[:denominator]
|
46
|
+
}
|
47
|
+
end
|
48
|
+
else
|
49
|
+
body[:monitor_search] = symbolized_options[:monitor_search] if symbolized_options[:monitor_search]
|
50
|
+
body[:monitor_ids] = symbolized_options[:monitor_ids] if symbolized_options[:monitor_ids]
|
51
|
+
body[:groups] = symbolized_options[:groups] if symbolized_options[:groups]
|
52
|
+
end
|
53
|
+
[:name, :thresholds, :tags, :description].each do |a|
|
54
|
+
body[a] = symbolized_options[a] if symbolized_options[a]
|
55
|
+
end
|
56
|
+
|
57
|
+
request(Net::HTTP::Put, "/api/#{API_VERSION}/slo/#{slo_id}", nil, body, true)
|
58
|
+
end
|
59
|
+
|
60
|
+
def get_service_level_objective(slo_id)
|
61
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/slo/#{slo_id}", nil, nil, false)
|
62
|
+
end
|
63
|
+
|
64
|
+
def search_service_level_objective(slo_ids, query, offset, limit)
|
65
|
+
params = {}
|
66
|
+
params[:offset] = offset unless offset.nil?
|
67
|
+
params[:limit] = limit unless limit.nil?
|
68
|
+
if !slo_ids.nil?
|
69
|
+
params[:ids] = slo_ids.join(',')
|
70
|
+
else
|
71
|
+
params[:query] = query
|
72
|
+
end
|
73
|
+
|
74
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/slo/", params, nil, false)
|
75
|
+
end
|
76
|
+
|
77
|
+
def delete_service_level_objective(slo_id)
|
78
|
+
request(Net::HTTP::Delete, "/api/#{API_VERSION}/slo/#{slo_id}", nil, nil, false)
|
79
|
+
end
|
80
|
+
|
81
|
+
def delete_many_service_level_objective(slo_ids)
|
82
|
+
body = {
|
83
|
+
ids: slo_ids
|
84
|
+
}
|
85
|
+
request(Net::HTTP::Delete, "/api/#{API_VERSION}/slo/", nil, body, true)
|
86
|
+
end
|
87
|
+
|
88
|
+
def delete_timeframes_service_level_objective(ops)
|
89
|
+
# ops is a hash of slo_id: [<timeframe>] to delete
|
90
|
+
request(Net::HTTP::Post, "/api/#{API_VERSION}/slo/bulk_delete", nil, ops, true)
|
91
|
+
end
|
92
|
+
|
93
|
+
def get_service_level_objective_history(slo_id, from_ts, to_ts)
|
94
|
+
params = {
|
95
|
+
from_ts: from_ts,
|
96
|
+
to_ts: to_ts
|
97
|
+
}
|
98
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/slo/#{slo_id}/history", params, nil, false)
|
99
|
+
end
|
100
|
+
|
101
|
+
def can_delete_service_level_objective(slo_ids)
|
102
|
+
params = {}
|
103
|
+
params[:ids] = if slo_ids.is_a? Array
|
104
|
+
slo_ids.join(',')
|
105
|
+
else
|
106
|
+
slo_ids
|
107
|
+
end
|
108
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/slo/can_delete", params, nil, false)
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
data/lib/dogapi/v1/snapshot.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'
|
2
6
|
|
3
7
|
module Dogapi
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'dogapi'
|
2
|
+
|
3
|
+
module Dogapi
|
4
|
+
class V1 # for namespacing
|
5
|
+
# SyntheticsService is the class responsible for dealing with the synthetics
|
6
|
+
class SyntheticsService < Dogapi::APIService
|
7
|
+
|
8
|
+
API_VERSION = 'v1'
|
9
|
+
|
10
|
+
# Create a synthetics test: POST /v1/synthetics/tests/
|
11
|
+
def create_synthetics_test(type, config, options = {})
|
12
|
+
body = {
|
13
|
+
'type' => type,
|
14
|
+
'config' => config
|
15
|
+
}.merge(options)
|
16
|
+
|
17
|
+
request(Net::HTTP::Post, "/api/#{API_VERSION}/synthetics/tests", nil, body, true)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Edit a synthetics test: PUT /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>
|
21
|
+
def update_synthetics_test(test_id, type, config, options = {})
|
22
|
+
body = {
|
23
|
+
'type' => type,
|
24
|
+
'config' => config
|
25
|
+
}.merge(options)
|
26
|
+
|
27
|
+
request(Net::HTTP::Put, "/api/#{API_VERSION}/synthetics/tests/#{test_id}", nil, body, true)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Delete synthetics tests
|
31
|
+
def delete_synthetics_tests(test_ids)
|
32
|
+
body = {
|
33
|
+
'public_ids' => test_ids
|
34
|
+
}
|
35
|
+
request(Net::HTTP::Post, "/api/#{API_VERSION}/synthetics/tests/delete", nil, body, true)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Start of pause a synthetics test: POST /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/status
|
39
|
+
def start_pause_synthetics_test(test_id, new_status)
|
40
|
+
body = {
|
41
|
+
'new_status' => new_status
|
42
|
+
}
|
43
|
+
request(Net::HTTP::Put, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/status", nil, body, true)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Get all synthetics tests: GET /v1/synthetics/tests
|
47
|
+
def get_all_synthetics_tests
|
48
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests", nil, nil, false)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Get info on a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>
|
52
|
+
def get_synthetics_test(test_id)
|
53
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}", nil, nil, false)
|
54
|
+
end
|
55
|
+
|
56
|
+
# Get the most recent results for a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/results
|
57
|
+
def get_synthetics_results(test_id)
|
58
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/results", nil, nil, false)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Get a specific result for a synthetics test:
|
62
|
+
# GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/results/<RESULT_ID>
|
63
|
+
def get_synthetics_result(test_id, result_id)
|
64
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/results/#{result_id}", nil, nil, false)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Get devices for browser checks: GET /v1/synthetics/browser/devices
|
68
|
+
def get_synthetics_devices
|
69
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/browser/devices", nil, nil, false)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Get available locations: GET /v1/synthetics/locations
|
73
|
+
def get_synthetics_locations
|
74
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/locations", nil, nil, false)
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|
data/lib/dogapi/v1/tag.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'
|
2
6
|
|
3
7
|
module Dogapi
|
data/lib/dogapi/v1/usage.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'
|
2
6
|
|
3
7
|
module Dogapi
|
data/lib/dogapi/v1/user.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'
|
2
6
|
|
3
7
|
module Dogapi
|
data/lib/dogapi/v2.rb
CHANGED
@@ -1 +1,5 @@
|
|
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/v2/dashboard_list'
|