dogapi 1.43.0 → 1.44.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee43257bd0dee8a6d716ec81374f9c9345037eadb1d64ae56948354058611d42
4
- data.tar.gz: f09c94bb876b09cf12dcf2bbe473b30e55964a62d8a78bedad6fbc54a6352e87
3
+ metadata.gz: c64317943c656727e705f3ba310961de9fa8b3fda8fbcb976095d634d7311ecd
4
+ data.tar.gz: bb3f1977f9bd6bcd6d22779e23e247803b7800a1a0770e266d461878b68d574c
5
5
  SHA512:
6
- metadata.gz: 7d69cb4d01bc6673e183f714899a2a21021114163a7f7d69d99a1ba73bd2badcb21f0795d6f78f3694ce24cee391ce1063566789ed3a85d7cbd19c25273b1ad5
7
- data.tar.gz: 362e14cea14f234a3fe8649dc2c6044e245d903e255a0a78c61e0577e54e1046fbecdd7d3cb5277a374845d82bb1c5a9f45143d1eab9635656908a3c9b8cd63a
6
+ metadata.gz: f2814b96964abfc35ade6827652aed52c0b2795aa71f47a4a8a9152d7f97a013bb18680060657df015aeb0cb925cce58a16780c67df56397256d9e4c10aa8fcc
7
+ data.tar.gz: f9b7cb7ec7486d40af67d12ad68e44787e3e890efb0a98a9a5093875eba00eb0c19556a6b4fd35246611ffdc4cfe3b1aa2750750d001f6e145a8fe52085aac46
@@ -14,4 +14,8 @@ Metrics/LineLength:
14
14
  Metrics/ModuleLength:
15
15
  Max: 200
16
16
 
17
+ # Our Client constructor has 8 arguments
18
+ Metrics/ParameterLists:
19
+ Enabled: false
20
+
17
21
  inherit_from: .rubocop_todo.yml
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 1.44.0 / 2020-12-10
4
+
5
+ * [Added] Allow skipping SSL verification. See [#246](https://github.com/DataDog/dogapi-rb/pull/246).
6
+
3
7
  ## 1.43.0 / 2020-12-07
4
8
 
5
9
  * [Fixed] find_localhost: Try both `hostname` and `hostname -f` before raising. See [#242](https://github.com/DataDog/dogapi-rb/pull/242).
@@ -86,11 +86,12 @@ module Dogapi
86
86
  # Superclass that deals with the details of communicating with the DataDog API
87
87
  class APIService
88
88
  attr_reader :api_key, :application_key
89
- def initialize(api_key, application_key, silent=true, timeout=nil, endpoint=nil)
89
+ def initialize(api_key, application_key, silent=true, timeout=nil, endpoint=nil, skip_ssl_validation=false)
90
90
  @api_key = api_key
91
91
  @application_key = application_key
92
92
  @api_host = endpoint || Dogapi.find_datadog_host()
93
93
  @silent = silent
94
+ @skip_ssl_validation = skip_ssl_validation
94
95
  @timeout = timeout || 5
95
96
  end
96
97
 
@@ -110,6 +111,9 @@ module Dogapi
110
111
  session = connection.new(uri.host, uri.port)
111
112
  session.open_timeout = @timeout
112
113
  session.use_ssl = uri.scheme == 'https'
114
+ if @skip_ssl_validation
115
+ session.verify_mode = OpenSSL::SSL::VERIFY_NONE
116
+ end
113
117
  session.start do |conn|
114
118
  conn.read_timeout = @timeout
115
119
  yield conn
@@ -13,7 +13,8 @@ module Dogapi
13
13
  # See Dogapi::V2 for the thick underlying clients
14
14
  class ClientV2
15
15
  attr_accessor :datadog_host
16
- def initialize(api_key, application_key=nil, host=nil, device=nil, silent=true, timeout=nil, endpoint=nil)
16
+ def initialize(api_key, application_key=nil, host=nil, device=nil, silent=true,
17
+ timeout=nil, endpoint=nil, skip_ssl_validation=false)
17
18
 
18
19
  if api_key
19
20
  @api_key = api_key
@@ -27,7 +28,7 @@ module Dogapi
27
28
  @device = device
28
29
 
29
30
  @dashboard_list_service_v2 = Dogapi::V2::DashboardListService.new(
30
- @api_key, @application_key, silent, timeout, @datadog_host
31
+ @api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation
31
32
  )
32
33
 
33
34
  end
@@ -64,7 +65,7 @@ module Dogapi
64
65
  # Support for API version 2.
65
66
 
66
67
  # rubocop:disable Metrics/MethodLength, Metrics/LineLength
67
- def initialize(api_key, application_key=nil, host=nil, device=nil, silent=true, timeout=nil, endpoint=nil)
68
+ def initialize(api_key, application_key=nil, host=nil, device=nil, silent=true, timeout=nil, endpoint=nil, skip_ssl_validation=false)
68
69
 
69
70
  if api_key
70
71
  @api_key = api_key
@@ -78,38 +79,38 @@ module Dogapi
78
79
  @device = device
79
80
 
80
81
  # FIXME: refactor to avoid all this code duplication
81
- @metric_svc = Dogapi::V1::MetricService.new(@api_key, @application_key, silent, timeout, @datadog_host)
82
- @event_svc = Dogapi::V1::EventService.new(@api_key, @application_key, silent, timeout, @datadog_host)
83
- @tag_svc = Dogapi::V1::TagService.new(@api_key, @application_key, silent, timeout, @datadog_host)
84
- @comment_svc = Dogapi::V1::CommentService.new(@api_key, @application_key, silent, timeout, @datadog_host)
85
- @search_svc = Dogapi::V1::SearchService.new(@api_key, @application_key, silent, timeout, @datadog_host)
86
- @dash_service = Dogapi::V1::DashService.new(@api_key, @application_key, silent, timeout, @datadog_host)
87
- @dashboard_service = Dogapi::V1::DashboardService.new(@api_key, @application_key, silent, timeout, @datadog_host)
82
+ @metric_svc = Dogapi::V1::MetricService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
83
+ @event_svc = Dogapi::V1::EventService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
84
+ @tag_svc = Dogapi::V1::TagService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
85
+ @comment_svc = Dogapi::V1::CommentService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
86
+ @search_svc = Dogapi::V1::SearchService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
87
+ @dash_service = Dogapi::V1::DashService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
88
+ @dashboard_service = Dogapi::V1::DashboardService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
88
89
  @dashboard_list_service = Dogapi::V1::DashboardListService.new(
89
- @api_key, @application_key, silent, timeout, @datadog_host
90
+ @api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation
90
91
  )
91
- @alert_svc = Dogapi::V1::AlertService.new(@api_key, @application_key, silent, timeout, @datadog_host)
92
- @user_svc = Dogapi::V1::UserService.new(@api_key, @application_key, silent, timeout, @datadog_host)
93
- @snapshot_svc = Dogapi::V1::SnapshotService.new(@api_key, @application_key, silent, timeout, @datadog_host)
94
- @embed_svc = Dogapi::V1::EmbedService.new(@api_key, @application_key, silent, timeout, @datadog_host)
95
- @screenboard_svc = Dogapi::V1::ScreenboardService.new(@api_key, @application_key, silent, timeout, @datadog_host)
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)
98
- @service_check_svc = Dogapi::V1::ServiceCheckService.new(@api_key, @application_key, silent, timeout, @datadog_host)
99
- @metadata_svc = Dogapi::V1::MetadataService.new(@api_key, @application_key, silent, timeout, @datadog_host)
92
+ @alert_svc = Dogapi::V1::AlertService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
93
+ @user_svc = Dogapi::V1::UserService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
94
+ @snapshot_svc = Dogapi::V1::SnapshotService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
95
+ @embed_svc = Dogapi::V1::EmbedService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
96
+ @screenboard_svc = Dogapi::V1::ScreenboardService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
97
+ @monitor_svc = Dogapi::V1::MonitorService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
98
+ @synthetics_svc = Dogapi::V1::SyntheticsService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
99
+ @service_check_svc = Dogapi::V1::ServiceCheckService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
100
+ @metadata_svc = Dogapi::V1::MetadataService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
100
101
  @legacy_event_svc = Dogapi::EventService.new(@datadog_host)
101
- @hosts_svc = Dogapi::V1::HostsService.new(@api_key, @application_key, silent, timeout, @datadog_host)
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)
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)
102
+ @hosts_svc = Dogapi::V1::HostsService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
103
+ @integration_svc = Dogapi::V1::IntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
104
+ @aws_integration_svc = Dogapi::V1::AwsIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
105
+ @aws_logs_svc = Dogapi::V1::AwsLogsService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
106
+ @usage_svc = Dogapi::V1::UsageService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
107
+ @azure_integration_svc = Dogapi::V1::AzureIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
108
+ @gcp_integration_svc = Dogapi::V1::GcpIntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host, skip_ssl_validation)
108
109
  @service_level_objective_svc = Dogapi::V1::ServiceLevelObjectiveService.new(@api_key, @application_key, silent,
109
- timeout, @datadog_host)
110
+ timeout, @datadog_host, skip_ssl_validation)
110
111
 
111
112
  # Support for Dashboard List API v2.
112
- @v2 = Dogapi::ClientV2.new(@api_key, @application_key, true, true, @datadog_host)
113
+ @v2 = Dogapi::ClientV2.new(@api_key, @application_key, true, true, @datadog_host, skip_ssl_validation)
113
114
 
114
115
  end
115
116
  # rubocop:enable Metrics/MethodLength, Metrics/LineLength
@@ -3,5 +3,5 @@
3
3
  # Copyright 2011-Present Datadog, Inc.
4
4
 
5
5
  module Dogapi
6
- VERSION = '1.43.0'
6
+ VERSION = '1.44.0'
7
7
  end
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.43.0
4
+ version: 1.44.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-07 00:00:00.000000000 Z
11
+ date: 2020-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json