azure_mgmt_devtestlabs 0.15.1 → 0.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +1 -3
  3. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule.rb +9 -0
  4. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb +9 -0
  5. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb +3 -0
  6. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/arm_template.rb +15 -0
  7. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb +3 -0
  8. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.rb +3 -0
  9. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact.rb +15 -0
  10. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb +4 -0
  11. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb +4 -0
  12. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb +8 -0
  13. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb +8 -0
  14. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb +3 -0
  15. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.rb +3 -0
  16. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact_source.rb +18 -0
  17. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb +17 -0
  18. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.rb +2 -0
  19. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb +4 -0
  20. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.rb +2 -0
  21. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb +5 -0
  22. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb +5 -0
  23. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status.rb +4 -0
  24. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.rb +4 -0
  25. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.rb +11 -0
  26. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.rb +11 -0
  27. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb +6 -0
  28. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/custom_image.rb +15 -0
  29. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb +4 -0
  30. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb +4 -0
  31. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb +4 -0
  32. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/day_details.rb +2 -0
  33. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/day_details_fragment.rb +2 -0
  34. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.rb +2 -0
  35. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.rb +2 -0
  36. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/disk.rb +17 -0
  37. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb +13 -0
  38. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb +4 -0
  39. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb +4 -0
  40. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb +3 -0
  41. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb +3 -0
  42. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/event.rb +2 -0
  43. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/event_fragment.rb +2 -0
  44. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb +3 -0
  45. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/external_subnet.rb +3 -0
  46. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.rb +3 -0
  47. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/formula.rb +15 -0
  48. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb +2 -0
  49. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/gallery_image.rb +13 -0
  50. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb +6 -0
  51. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb +6 -0
  52. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb +6 -0
  53. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb +2 -0
  54. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +2 -0
  55. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/hour_details.rb +2 -0
  56. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.rb +2 -0
  57. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/identity_properties.rb +5 -0
  58. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb +4 -0
  59. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb +4 -0
  60. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab.rb +17 -0
  61. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_cost.rb +19 -0
  62. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_cost_details_properties.rb +4 -0
  63. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_properties.rb +2 -0
  64. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb +11 -0
  65. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_resource_cost_properties.rb +10 -0
  66. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb +2 -0
  67. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb +39 -0
  68. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb +37 -0
  69. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb +38 -0
  70. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb +2 -0
  71. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb +10 -0
  72. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb +10 -0
  73. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/notification_channel.rb +14 -0
  74. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/notification_channel_fragment.rb +13 -0
  75. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/notification_settings.rb +4 -0
  76. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb +4 -0
  77. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb +3 -0
  78. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/parameter_info.rb +3 -0
  79. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.rb +3 -0
  80. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_properties.rb +2 -0
  81. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/policy.rb +16 -0
  82. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb +15 -0
  83. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb +4 -0
  84. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/policy_violation.rb +3 -0
  85. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/port.rb +3 -0
  86. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/port_fragment.rb +3 -0
  87. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/resource.rb +7 -0
  88. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_arm_template.rb +4 -0
  89. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact.rb +4 -0
  90. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact_source.rb +4 -0
  91. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_custom_image.rb +4 -0
  92. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_disk.rb +4 -0
  93. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_dtl_environment.rb +4 -0
  94. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_formula.rb +4 -0
  95. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_gallery_image.rb +4 -0
  96. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab.rb +4 -0
  97. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_vhd.rb +4 -0
  98. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_virtual_machine.rb +4 -0
  99. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_notification_channel.rb +4 -0
  100. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_policy.rb +4 -0
  101. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_schedule.rb +4 -0
  102. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_secret.rb +4 -0
  103. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_service_runner.rb +4 -0
  104. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_user.rb +4 -0
  105. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/response_with_continuation_virtual_network.rb +4 -0
  106. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.rb +3 -0
  107. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/schedule.rb +18 -0
  108. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb +17 -0
  109. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/secret.rb +10 -0
  110. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/service_runner.rb +8 -0
  111. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb +3 -0
  112. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.rb +3 -0
  113. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb +12 -0
  114. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/subnet.rb +4 -0
  115. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/subnet_fragment.rb +4 -0
  116. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/subnet_override.rb +7 -0
  117. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb +7 -0
  118. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb +3 -0
  119. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.rb +3 -0
  120. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb +8 -0
  121. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/user.rb +12 -0
  122. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/user_fragment.rb +11 -0
  123. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/user_identity.rb +6 -0
  124. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb +6 -0
  125. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/user_secret_store.rb +3 -0
  126. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.rb +3 -0
  127. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/virtual_network.rb +18 -0
  128. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb +17 -0
  129. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/week_details.rb +4 -0
  130. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/week_details_fragment.rb +4 -0
  131. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb +2 -0
  132. data/lib/profiles/latest/devtestlabs_latest_profile_client.rb +1 -3
  133. data/lib/version.rb +1 -1
  134. metadata +10 -8
  135. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/version.rb +0 -8
  136. data/lib/profiles/common/configurable.rb +0 -86
  137. data/lib/profiles/common/default.rb +0 -57
@@ -26,6 +26,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
26
26
  #
27
27
  def self.mapper()
28
28
  {
29
+ client_side_validation: true,
29
30
  required: false,
30
31
  serialized_name: 'WeekDetails',
31
32
  type: {
@@ -33,11 +34,13 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
33
34
  class_name: 'WeekDetails',
34
35
  model_properties: {
35
36
  weekdays: {
37
+ client_side_validation: true,
36
38
  required: false,
37
39
  serialized_name: 'weekdays',
38
40
  type: {
39
41
  name: 'Sequence',
40
42
  element: {
43
+ client_side_validation: true,
41
44
  required: false,
42
45
  serialized_name: 'StringElementType',
43
46
  type: {
@@ -47,6 +50,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
47
50
  }
48
51
  },
49
52
  time: {
53
+ client_side_validation: true,
50
54
  required: false,
51
55
  serialized_name: 'time',
52
56
  type: {
@@ -26,6 +26,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
26
26
  #
27
27
  def self.mapper()
28
28
  {
29
+ client_side_validation: true,
29
30
  required: false,
30
31
  serialized_name: 'WeekDetailsFragment',
31
32
  type: {
@@ -33,11 +34,13 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
33
34
  class_name: 'WeekDetailsFragment',
34
35
  model_properties: {
35
36
  weekdays: {
37
+ client_side_validation: true,
36
38
  required: false,
37
39
  serialized_name: 'weekdays',
38
40
  type: {
39
41
  name: 'Sequence',
40
42
  element: {
43
+ client_side_validation: true,
41
44
  required: false,
42
45
  serialized_name: 'StringElementType',
43
46
  type: {
@@ -47,6 +50,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
47
50
  }
48
51
  },
49
52
  time: {
53
+ client_side_validation: true,
50
54
  required: false,
51
55
  serialized_name: 'time',
52
56
  type: {
@@ -24,6 +24,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
24
24
  #
25
25
  def self.mapper()
26
26
  {
27
+ client_side_validation: true,
27
28
  required: false,
28
29
  serialized_name: 'WindowsOsInfo',
29
30
  type: {
@@ -31,6 +32,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
31
32
  class_name: 'WindowsOsInfo',
32
33
  model_properties: {
33
34
  windows_os_state: {
35
+ client_side_validation: true,
34
36
  required: false,
35
37
  serialized_name: 'windowsOsState',
36
38
  type: {
@@ -4,15 +4,13 @@
4
4
 
5
5
  require 'profiles/latest/devtestlabs_module_definition'
6
6
  require 'profiles/latest/modules/devtestlabs_profile_module'
7
- require 'profiles/common/configurable'
8
- require 'profiles/common/default'
9
7
 
10
8
  module Azure::DevTestLabs::Profiles::Latest::Mgmt
11
9
  #
12
10
  # Client class for the Latest profile SDK.
13
11
  #
14
12
  class Client < DevTestLabsClass
15
- include Azure::Common::Configurable
13
+ include MsRestAzure::Common::Configurable
16
14
 
17
15
 
18
16
  def initialize(options = {})
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::DevTestLabs::Mgmt
6
- VERSION = '0.15.1'
6
+ VERSION = '0.15.2'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_devtestlabs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
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-30 00:00:00.000000000 Z
11
+ date: 2017-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.9.0
75
+ version: 0.10.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.9.0
82
+ version: 0.10.0
83
83
  description: Microsoft Azure Dev Test Lab Management Client Library for Ruby
84
84
  email: azrubyteam@microsoft.com
85
85
  executables: []
@@ -258,14 +258,11 @@ files:
258
258
  - lib/2016-05-15/generated/azure_mgmt_devtestlabs/secrets.rb
259
259
  - lib/2016-05-15/generated/azure_mgmt_devtestlabs/service_runners.rb
260
260
  - lib/2016-05-15/generated/azure_mgmt_devtestlabs/users.rb
261
- - lib/2016-05-15/generated/azure_mgmt_devtestlabs/version.rb
262
261
  - lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machine_schedules.rb
263
262
  - lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb
264
263
  - lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_networks.rb
265
264
  - lib/azure_mgmt_devtestlabs.rb
266
265
  - lib/module_definition.rb
267
- - lib/profiles/common/configurable.rb
268
- - lib/profiles/common/default.rb
269
266
  - lib/profiles/latest/devtestlabs_latest_profile_client.rb
270
267
  - lib/profiles/latest/devtestlabs_module_definition.rb
271
268
  - lib/profiles/latest/modules/devtestlabs_profile_module.rb
@@ -273,7 +270,12 @@ files:
273
270
  homepage: https://aka.ms/azure-sdk-for-ruby
274
271
  licenses:
275
272
  - MIT
276
- metadata: {}
273
+ metadata:
274
+ bug_tracker_uri: https://github.com/Azure/azure-sdk-for-ruby/issues
275
+ changelog_uri: https://github.com/Azure/azure-sdk-for-ruby/blob/master/ChangeLog.md
276
+ documentation_uri: https://azure.microsoft.com/en-us/develop/ruby/
277
+ homepage_uri: https://aka.ms/azure-sdk-for-ruby
278
+ source_code_uri: https://github.com/Azure/azure-sdk-for-ruby/tree/master/management/azure_mgmt_devtestlabs
277
279
  post_install_message:
278
280
  rdoc_options: []
279
281
  require_paths:
@@ -1,8 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator.
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::DevTestLabs::Mgmt::V2016_05_15
7
- VERSION = '0.15.1'
8
- end
@@ -1,86 +0,0 @@
1
- # encoding: utf-8
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License. See License.txt in the project root for license information.
4
-
5
- module Azure::Common
6
- # The Azure::Common::Configurable module provides basic configuration for Azure activities.
7
- module Configurable
8
- # @return [String] Azure tenant id (also known as domain).
9
- attr_accessor :tenant_id
10
-
11
- # @return [String] Azure client id.
12
- attr_accessor :client_id
13
-
14
- # @return [String] Azure secret key.
15
- attr_accessor :client_secret
16
-
17
- # @return [String] Azure subscription id.
18
- attr_accessor :subscription_id
19
-
20
- # @return [MsRestAzure::ActiveDirectoryServiceSettings] Azure active directory service settings.
21
- attr_accessor :active_directory_settings
22
-
23
- # @return [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
24
- attr_accessor :credentials
25
-
26
- class << self
27
- #
28
- # List of configurable keys for {Azure::Common::Client}.
29
- # @return [Array] of option keys.
30
- #
31
- def keys
32
- @keys ||= [:tenant_id, :client_id, :client_secret, :subscription_id, :active_directory_settings]
33
- end
34
- end
35
-
36
- #
37
- # Set configuration options using a block.
38
- #
39
- def configure
40
- yield self
41
- end
42
-
43
- #
44
- # Resets the configurable options to provided options or defaults.
45
- # This will also creates MsRest::TokenCredentials to be used for subsequent Azure Resource Manager clients.
46
- #
47
- def reset!(options = {})
48
- Azure::Common::Configurable.keys.each do |key|
49
- default_value = Azure::Common::Default.options[key]
50
- instance_variable_set(:"@#{key}", options.fetch(key, default_value))
51
- end
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
-
65
- self
66
- end
67
-
68
- def config
69
- self
70
- end
71
-
72
- private
73
-
74
- #
75
- # configures configurable options to default values
76
- #
77
- def setup_default_options
78
- opts = {}
79
- Azure::Common::Configurable.keys.map do |key|
80
- opts[key] = Azure::Common::Default.options[key]
81
- end
82
-
83
- opts
84
- end
85
- end
86
- end
@@ -1,57 +0,0 @@
1
- # encoding: utf-8
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License. See License.txt in the project root for license information.
4
-
5
- module Azure::Common
6
- module Default
7
- class << self
8
- #
9
- # Default Azure Tenant Id.
10
- # @return [String] Azure Tenant Id.
11
- #
12
- def tenant_id
13
- ENV['AZURE_TENANT_ID']
14
- end
15
-
16
- #
17
- # Default Azure Client Id.
18
- # @return [String] Azure Client Id.
19
- #
20
- def client_id
21
- ENV['AZURE_CLIENT_ID']
22
- end
23
-
24
- #
25
- # Default Azure Client Secret.
26
- # @return [String] Azure Client Secret.
27
- #
28
- def client_secret
29
- ENV['AZURE_CLIENT_SECRET']
30
- end
31
-
32
- #
33
- # Default Azure Subscription Id.
34
- # @return [String] Azure Subscription Id.
35
- #
36
- def subscription_id
37
- ENV['AZURE_SUBSCRIPTION_ID']
38
- end
39
-
40
- #
41
- # Default Azure Active Directory Service Settings.
42
- # @return [MsRestAzure::ActiveDirectoryServiceSettings] Azure Active Directory Service Settings.
43
- #
44
- def active_directory_settings
45
- MsRestAzure::ActiveDirectoryServiceSettings.get_azure_settings
46
- end
47
-
48
- #
49
- # Configuration options.
50
- # @return [Hash] Configuration options.
51
- #
52
- def options
53
- Hash[Azure::Common::Configurable.keys.map { |key| [key, send(key)]}]
54
- end
55
- end
56
- end
57
- end