azure_mgmt_monitor 0.15.0 → 0.15.1

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
  SHA1:
3
- metadata.gz: 51485ca6ef1f65bd767f51ef4165bd1f030e7555
4
- data.tar.gz: af532c664e06414b318f1a01bb8f0d3371439666
3
+ metadata.gz: 75158d17318f7e26baed2574c0931940037b3de7
4
+ data.tar.gz: f493349b088811e49b0fba512511103b42f2f4be
5
5
  SHA512:
6
- metadata.gz: b9f49e4e8be313c52ae4325249fa9d18d151b1b0c32c6a1bf2487e0c80e7c9fd09c7251a08b62567535439805fc5f62e7492221b864b4129775e975c68411684
7
- data.tar.gz: cba81ddbecec30bf4754d85be939c0c80a1df2bb0cfc991bbaf20b5a3750135f32211a87fc620c618c78cb6d627dc1906a07d9f63d164a95c2e6bcb1a8922cfb
6
+ metadata.gz: b3a77da70d9380d4a6b7e16ee5179dbcfa2123e4ff967d585884fe51c3289161388838e6b5fa2f92387675dda1ed89387f03fb68ce69a39288493a0bf7df5d78
7
+ data.tar.gz: 439581312d2bb5da2fb7c7852f957b8243da714403ae68beeecf49d49f8666517ccec65c42025133a32b82c0182eb23c1619ff70f5f29a1b55026099f954dbf1
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::Monitor::Mgmt::V2015_04_01
7
- VERSION = '0.15.0'
7
+ VERSION = '0.15.1'
8
8
  end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::Monitor::Mgmt::V2016_03_01
7
- VERSION = '0.15.0'
7
+ VERSION = '0.15.1'
8
8
  end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::Monitor::Mgmt::V2016_09_01
7
- VERSION = '0.15.0'
7
+ VERSION = '0.15.1'
8
8
  end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::Monitor::Mgmt::V2017_04_01
7
- VERSION = '0.15.0'
7
+ VERSION = '0.15.1'
8
8
  end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::Monitor::Mgmt::V2017_05_01_preview
7
- VERSION = '0.15.0'
7
+ VERSION = '0.15.1'
8
8
  end
@@ -2,8 +2,8 @@
2
2
  # Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
- module Azure::ARM
6
- # The Azure::ARM::Configurable module provides basic configuration for Azure ARM activities.
5
+ module Azure::Common
6
+ # The Azure::Common::Configurable module provides basic configuration for Azure activities.
7
7
  module Configurable
8
8
  # @return [String] Azure tenant id (also known as domain).
9
9
  attr_accessor :tenant_id
@@ -25,11 +25,11 @@ module Azure::ARM
25
25
 
26
26
  class << self
27
27
  #
28
- # List of configurable keys for {Azure::ARM::Client}.
28
+ # List of configurable keys for {Azure::Common::Client}.
29
29
  # @return [Array] of option keys.
30
30
  #
31
31
  def keys
32
- @keys ||= [:tenant_id, :client_id, :client_secret, :subscription_id, :active_directory_settings, :credentials]
32
+ @keys ||= [:tenant_id, :client_id, :client_secret, :subscription_id, :active_directory_settings]
33
33
  end
34
34
  end
35
35
 
@@ -45,11 +45,23 @@ module Azure::ARM
45
45
  # This will also creates MsRest::TokenCredentials to be used for subsequent Azure Resource Manager clients.
46
46
  #
47
47
  def reset!(options = {})
48
- Azure::ARM::Configurable.keys.each do |key|
49
- default_value = Azure::ARM::Default.options[key]
48
+ Azure::Common::Configurable.keys.each do |key|
49
+ default_value = Azure::Common::Default.options[key]
50
50
  instance_variable_set(:"@#{key}", options.fetch(key, default_value))
51
51
  end
52
52
 
53
+ fail ArgumentError, 'tenant_id is nil' if self.tenant_id.nil?
54
+ fail ArgumentError, 'client_id is nil' if self.client_id.nil?
55
+ fail ArgumentError, 'client_secret is nil' if self.client_secret.nil?
56
+ fail ArgumentError, 'subscription_id is nil' if self.subscription_id.nil?
57
+ fail ArgumentError, 'active_directory_settings is nil' if self.active_directory_settings.nil?
58
+
59
+ default_value = MsRest::TokenCredentials.new(
60
+ MsRestAzure::ApplicationTokenProvider.new(
61
+ self.tenant_id, self.client_id, self.client_secret, self.active_directory_settings))
62
+
63
+ instance_variable_set(:"@credentials", options.fetch(:credentials, default_value))
64
+
53
65
  self
54
66
  end
55
67
 
@@ -62,11 +74,12 @@ module Azure::ARM
62
74
  #
63
75
  # configures configurable options to default values
64
76
  #
65
- def setup_options
77
+ def setup_default_options
66
78
  opts = {}
67
- Azure::ARM::Configurable.keys.map do |key|
68
- opts[key] = Azure::ARM::Default.options[key]
79
+ Azure::Common::Configurable.keys.map do |key|
80
+ opts[key] = Azure::Common::Default.options[key]
69
81
  end
82
+
70
83
  opts
71
84
  end
72
85
  end
@@ -2,8 +2,7 @@
2
2
  # Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
- module Azure::ARM
6
- # Default configuration options for {Azure::ARM.Client}
5
+ module Azure::Common
7
6
  module Default
8
7
  class << self
9
8
  #
@@ -38,16 +37,6 @@ module Azure::ARM
38
37
  ENV['AZURE_SUBSCRIPTION_ID']
39
38
  end
40
39
 
41
- #
42
- # Default Azure credentials to authorize HTTP requests made by the service client.
43
- # @return [MsRest::ServiceClientCredentials] Azure credentials to authorize HTTP requests made by the service client.
44
- #
45
- def credentials
46
- MsRest::TokenCredentials.new(
47
- MsRestAzure::ApplicationTokenProvider.new(
48
- self.tenant_id, self.client_id, self.client_secret, self.active_directory_settings))
49
- end
50
-
51
40
  #
52
41
  # Default Azure Active Directory Service Settings.
53
42
  # @return [MsRestAzure::ActiveDirectoryServiceSettings] Azure Active Directory Service Settings.
@@ -61,7 +50,7 @@ module Azure::ARM
61
50
  # @return [Hash] Configuration options.
62
51
  #
63
52
  def options
64
- Hash[Azure::ARM::Configurable.keys.map{|key| [key, send(key)]}]
53
+ Hash[Azure::Common::Configurable.keys.map { |key| [key, send(key)]}]
65
54
  end
66
55
  end
67
56
  end
@@ -96,7 +96,7 @@ module Azure::Monitor::Profiles::Latest::Mgmt
96
96
 
97
97
  def initialize(options = {})
98
98
  if options.is_a?(Hash) && options.length == 0
99
- @options = setup_options
99
+ @options = setup_default_options
100
100
  else
101
101
  @options = options
102
102
  end
@@ -12,22 +12,12 @@ module Azure::Monitor::Profiles::Latest::Mgmt
12
12
  # Client class for the Latest profile SDK.
13
13
  #
14
14
  class Client < MonitorClass
15
- include Azure::ARM::Configurable
15
+ include Azure::Common::Configurable
16
16
 
17
17
 
18
18
  def initialize(options = {})
19
19
  super(options)
20
20
  end
21
21
 
22
- def credentials
23
- if @credentials.nil?
24
- self.active_directory_settings ||= Azure::ARM::Default.active_directory_settings
25
-
26
- @credentials = MsRest::TokenCredentials.new(
27
- MsRestAzure::ApplicationTokenProvider.new(
28
- self.tenant_id, self.client_id, self.client_secret, self.active_directory_settings))
29
- end
30
- @credentials
31
- end
32
22
  end
33
23
  end
data/lib/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::Monitor::Mgmt
6
- VERSION = '0.15.0'
6
+ VERSION = '0.15.1'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-17 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler