azure_mgmt_hdinsight 0.17.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.
Files changed (165) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight.rb +106 -0
  4. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/applications.rb +601 -0
  5. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/clusters.rb +1292 -0
  6. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/configurations.rb +289 -0
  7. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/extension_operations.rb +653 -0
  8. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb +161 -0
  9. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/locations.rb +201 -0
  10. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application.rb +104 -0
  11. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application_get_endpoint.rb +68 -0
  12. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application_get_https_endpoint.rb +87 -0
  13. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application_list_result.rb +102 -0
  14. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application_properties.rb +210 -0
  15. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/async_operation_state.rb +17 -0
  16. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/capabilities_result.rb +148 -0
  17. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster.rb +121 -0
  18. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_parameters_extended.rb +89 -0
  19. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_properties.rb +132 -0
  20. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_definition.rb +88 -0
  21. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_disk_encryption_parameters.rb +70 -0
  22. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_get_properties.rb +209 -0
  23. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity.rb +101 -0
  24. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity_user_assigned_identities_value.rb +61 -0
  25. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_persisted_script_actions_result.rb +68 -0
  26. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_result.rb +99 -0
  27. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_runtime_script_action_detail_result.rb +70 -0
  28. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_request.rb +57 -0
  29. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_response.rb +59 -0
  30. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_patch_parameters.rb +54 -0
  31. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_resize_parameters.rb +46 -0
  32. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/compute_profile.rb +55 -0
  33. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/connectivity_endpoint.rb +79 -0
  34. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/data_disks_groups.rb +71 -0
  35. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/directory_type.rb +15 -0
  36. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/disk_encryption_properties.rb +95 -0
  37. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/error_response.rb +57 -0
  38. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/errors.rb +57 -0
  39. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/execute_script_action_parameters.rb +67 -0
  40. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/extension.rb +57 -0
  41. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/hardware_profile.rb +46 -0
  42. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/hdinsight_cluster_provisioning_state.rb +19 -0
  43. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/json_web_key_encryption_algorithm.rb +17 -0
  44. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/linux_operating_system_profile.rb +69 -0
  45. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/localized_name.rb +57 -0
  46. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/operation.rb +58 -0
  47. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/operation_display.rb +69 -0
  48. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/operation_list_result.rb +101 -0
  49. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/operation_resource.rb +60 -0
  50. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/os_profile.rb +47 -0
  51. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/ostype.rb +16 -0
  52. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/proxy_resource.rb +63 -0
  53. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/quota_capability.rb +56 -0
  54. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/quota_info.rb +46 -0
  55. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/regional_quota_capability.rb +68 -0
  56. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/regions_capability.rb +54 -0
  57. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/resource.rb +80 -0
  58. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/resource_identity_type.rb +18 -0
  59. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/role.rb +144 -0
  60. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action.rb +100 -0
  61. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action_detail.rb +178 -0
  62. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_action.rb +68 -0
  63. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_history_list.rb +101 -0
  64. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_summary.rb +60 -0
  65. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_action_persisted_get_response_spec.rb +99 -0
  66. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_actions_list.rb +100 -0
  67. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/security_profile.rb +159 -0
  68. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/ssh_profile.rb +55 -0
  69. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/ssh_public_key.rb +46 -0
  70. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb +93 -0
  71. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/storage_profile.rb +56 -0
  72. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/tier.rb +16 -0
  73. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/tracked_resource.rb +92 -0
  74. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/usage.rb +81 -0
  75. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/usages_list_result.rb +55 -0
  76. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/version_spec.rb +87 -0
  77. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/versions_capability.rb +55 -0
  78. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/virtual_network_profile.rb +57 -0
  79. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/vm_size_compatibility_filter.rb +141 -0
  80. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/vm_sizes_capability.rb +54 -0
  81. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/module_definition.rb +9 -0
  82. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/operations.rb +215 -0
  83. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/script_actions.rb +408 -0
  84. data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/script_execution_history.rb +312 -0
  85. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight.rb +98 -0
  86. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/applications.rb +601 -0
  87. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb +1292 -0
  88. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/configurations.rb +289 -0
  89. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/extensions.rb +735 -0
  90. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb +161 -0
  91. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/locations.rb +113 -0
  92. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application.rb +104 -0
  93. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_endpoint.rb +68 -0
  94. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_https_endpoint.rb +87 -0
  95. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_list_result.rb +102 -0
  96. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_properties.rb +210 -0
  97. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/async_operation_state.rb +17 -0
  98. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster.rb +121 -0
  99. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_parameters_extended.rb +89 -0
  100. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_properties.rb +132 -0
  101. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_definition.rb +88 -0
  102. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_disk_encryption_parameters.rb +70 -0
  103. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_get_properties.rb +209 -0
  104. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity.rb +101 -0
  105. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity_user_assigned_identities_value.rb +61 -0
  106. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_persisted_script_actions_result.rb +68 -0
  107. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_result.rb +99 -0
  108. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_runtime_script_action_detail_result.rb +70 -0
  109. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_request.rb +57 -0
  110. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_response.rb +59 -0
  111. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_patch_parameters.rb +54 -0
  112. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_resize_parameters.rb +46 -0
  113. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/compute_profile.rb +55 -0
  114. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/connectivity_endpoint.rb +79 -0
  115. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/data_disks_groups.rb +71 -0
  116. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/directory_type.rb +15 -0
  117. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/disk_encryption_properties.rb +95 -0
  118. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/error_response.rb +57 -0
  119. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/errors.rb +57 -0
  120. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/execute_script_action_parameters.rb +67 -0
  121. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/extension.rb +57 -0
  122. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/hardware_profile.rb +46 -0
  123. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/hdinsight_cluster_provisioning_state.rb +19 -0
  124. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/json_web_key_encryption_algorithm.rb +17 -0
  125. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/linux_operating_system_profile.rb +69 -0
  126. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/localized_name.rb +57 -0
  127. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation.rb +58 -0
  128. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_display.rb +69 -0
  129. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_list_result.rb +101 -0
  130. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_resource.rb +60 -0
  131. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/os_profile.rb +47 -0
  132. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ostype.rb +16 -0
  133. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/proxy_resource.rb +63 -0
  134. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/quota_info.rb +46 -0
  135. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/resource.rb +80 -0
  136. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/resource_identity_type.rb +18 -0
  137. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/role.rb +144 -0
  138. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action.rb +100 -0
  139. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action_detail.rb +178 -0
  140. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action.rb +68 -0
  141. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_history_list.rb +101 -0
  142. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_summary.rb +60 -0
  143. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_persisted_get_response_spec.rb +99 -0
  144. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_actions_list.rb +100 -0
  145. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/security_profile.rb +159 -0
  146. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_profile.rb +55 -0
  147. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_public_key.rb +46 -0
  148. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb +93 -0
  149. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_profile.rb +56 -0
  150. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/tier.rb +16 -0
  151. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/tracked_resource.rb +92 -0
  152. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usage.rb +81 -0
  153. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usages_list_result.rb +55 -0
  154. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/virtual_network_profile.rb +57 -0
  155. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/module_definition.rb +9 -0
  156. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/operations.rb +215 -0
  157. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/script_actions.rb +408 -0
  158. data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/script_execution_history.rb +312 -0
  159. data/lib/azure_mgmt_hdinsight.rb +7 -0
  160. data/lib/module_definition.rb +8 -0
  161. data/lib/profiles/latest/hdinsight_latest_profile_client.rb +40 -0
  162. data/lib/profiles/latest/hdinsight_module_definition.rb +8 -0
  163. data/lib/profiles/latest/modules/hdinsight_profile_module.rb +327 -0
  164. data/lib/version.rb +7 -0
  165. metadata +282 -0
@@ -0,0 +1,289 @@
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::Hdinsight::Mgmt::V2018_06_01_preview
7
+ #
8
+ # HDInsight Management Client
9
+ #
10
+ class Configurations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Configurations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [HDInsightManagementClient] reference to the HDInsightManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Configures the configuration on the specified cluster.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param cluster_name [String] The name of the cluster.
29
+ # @param configuration_name [String] The name of the cluster configuration.
30
+ # @param parameters [Hash{String => String}] The cluster configurations.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ def update(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:nil)
35
+ response = update_async(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:custom_headers).value!
36
+ nil
37
+ end
38
+
39
+ #
40
+ # @param resource_group_name [String] The name of the resource group.
41
+ # @param cluster_name [String] The name of the cluster.
42
+ # @param configuration_name [String] The name of the cluster configuration.
43
+ # @param parameters [Hash{String => String}] The cluster configurations.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [Concurrent::Promise] promise which provides async access to http
48
+ # response.
49
+ #
50
+ def update_async(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:nil)
51
+ # Send request
52
+ promise = begin_update_async(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:custom_headers)
53
+
54
+ promise = promise.then do |response|
55
+ # Defining deserialization method.
56
+ deserialize_method = lambda do |parsed_response|
57
+ end
58
+
59
+ # Waiting for response.
60
+ @client.get_long_running_operation_result(response, deserialize_method)
61
+ end
62
+
63
+ promise
64
+ end
65
+
66
+ #
67
+ # The configuration object for the specified cluster.
68
+ #
69
+ # @param resource_group_name [String] The name of the resource group.
70
+ # @param cluster_name [String] The name of the cluster.
71
+ # @param configuration_name [String] The name of the cluster configuration.
72
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
73
+ # will be added to the HTTP request.
74
+ #
75
+ # @return [Hash] operation results.
76
+ #
77
+ def get(resource_group_name, cluster_name, configuration_name, custom_headers:nil)
78
+ response = get_async(resource_group_name, cluster_name, configuration_name, custom_headers:custom_headers).value!
79
+ response.body unless response.nil?
80
+ end
81
+
82
+ #
83
+ # The configuration object for the specified cluster.
84
+ #
85
+ # @param resource_group_name [String] The name of the resource group.
86
+ # @param cluster_name [String] The name of the cluster.
87
+ # @param configuration_name [String] The name of the cluster configuration.
88
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
89
+ # will be added to the HTTP request.
90
+ #
91
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
92
+ #
93
+ def get_with_http_info(resource_group_name, cluster_name, configuration_name, custom_headers:nil)
94
+ get_async(resource_group_name, cluster_name, configuration_name, custom_headers:custom_headers).value!
95
+ end
96
+
97
+ #
98
+ # The configuration object for the specified cluster.
99
+ #
100
+ # @param resource_group_name [String] The name of the resource group.
101
+ # @param cluster_name [String] The name of the cluster.
102
+ # @param configuration_name [String] The name of the cluster configuration.
103
+ # @param [Hash{String => String}] A hash of custom headers that will be added
104
+ # to the HTTP request.
105
+ #
106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
107
+ #
108
+ def get_async(resource_group_name, cluster_name, configuration_name, custom_headers:nil)
109
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
110
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
111
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
112
+ fail ArgumentError, 'configuration_name is nil' if configuration_name.nil?
113
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
114
+
115
+
116
+ request_headers = {}
117
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
118
+
119
+ # Set Headers
120
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
121
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
122
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}'
123
+
124
+ request_url = @base_url || @client.base_url
125
+
126
+ options = {
127
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
128
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'configurationName' => configuration_name},
129
+ query_params: {'api-version' => @client.api_version},
130
+ headers: request_headers.merge(custom_headers || {}),
131
+ base_url: request_url
132
+ }
133
+ promise = @client.make_request_async(:get, path_template, options)
134
+
135
+ promise = promise.then do |result|
136
+ http_response = result.response
137
+ status_code = http_response.status
138
+ response_content = http_response.body
139
+ unless status_code == 200
140
+ error_model = JSON.load(response_content)
141
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
142
+ end
143
+
144
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
145
+ # Deserialize Response
146
+ if status_code == 200
147
+ begin
148
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
149
+ result_mapper = {
150
+ client_side_validation: true,
151
+ required: false,
152
+ serialized_name: 'parsed_response',
153
+ type: {
154
+ name: 'Dictionary',
155
+ value: {
156
+ client_side_validation: true,
157
+ required: false,
158
+ serialized_name: 'StringElementType',
159
+ type: {
160
+ name: 'String'
161
+ }
162
+ }
163
+ }
164
+ }
165
+ result.body = @client.deserialize(result_mapper, parsed_response)
166
+ rescue Exception => e
167
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
168
+ end
169
+ end
170
+
171
+ result
172
+ end
173
+
174
+ promise.execute
175
+ end
176
+
177
+ #
178
+ # Configures the configuration on the specified cluster.
179
+ #
180
+ # @param resource_group_name [String] The name of the resource group.
181
+ # @param cluster_name [String] The name of the cluster.
182
+ # @param configuration_name [String] The name of the cluster configuration.
183
+ # @param parameters [Hash{String => String}] The cluster configurations.
184
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
185
+ # will be added to the HTTP request.
186
+ #
187
+ #
188
+ def begin_update(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:nil)
189
+ response = begin_update_async(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:custom_headers).value!
190
+ nil
191
+ end
192
+
193
+ #
194
+ # Configures the configuration on the specified cluster.
195
+ #
196
+ # @param resource_group_name [String] The name of the resource group.
197
+ # @param cluster_name [String] The name of the cluster.
198
+ # @param configuration_name [String] The name of the cluster configuration.
199
+ # @param parameters [Hash{String => String}] The cluster configurations.
200
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
201
+ # will be added to the HTTP request.
202
+ #
203
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
204
+ #
205
+ def begin_update_with_http_info(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:nil)
206
+ begin_update_async(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:custom_headers).value!
207
+ end
208
+
209
+ #
210
+ # Configures the configuration on the specified cluster.
211
+ #
212
+ # @param resource_group_name [String] The name of the resource group.
213
+ # @param cluster_name [String] The name of the cluster.
214
+ # @param configuration_name [String] The name of the cluster configuration.
215
+ # @param parameters [Hash{String => String}] The cluster configurations.
216
+ # @param [Hash{String => String}] A hash of custom headers that will be added
217
+ # to the HTTP request.
218
+ #
219
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
220
+ #
221
+ def begin_update_async(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:nil)
222
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
223
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
224
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
225
+ fail ArgumentError, 'configuration_name is nil' if configuration_name.nil?
226
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
227
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
228
+
229
+
230
+ request_headers = {}
231
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
232
+
233
+ # Set Headers
234
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
235
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
236
+
237
+ # Serialize Request
238
+ request_mapper = {
239
+ client_side_validation: true,
240
+ required: true,
241
+ serialized_name: 'parameters',
242
+ type: {
243
+ name: 'Dictionary',
244
+ value: {
245
+ client_side_validation: true,
246
+ required: false,
247
+ serialized_name: 'StringElementType',
248
+ type: {
249
+ name: 'String'
250
+ }
251
+ }
252
+ }
253
+ }
254
+ request_content = @client.serialize(request_mapper, parameters)
255
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
256
+
257
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}'
258
+
259
+ request_url = @base_url || @client.base_url
260
+
261
+ options = {
262
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
263
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'configurationName' => configuration_name},
264
+ query_params: {'api-version' => @client.api_version},
265
+ body: request_content,
266
+ headers: request_headers.merge(custom_headers || {}),
267
+ base_url: request_url
268
+ }
269
+ promise = @client.make_request_async(:post, path_template, options)
270
+
271
+ promise = promise.then do |result|
272
+ http_response = result.response
273
+ status_code = http_response.status
274
+ response_content = http_response.body
275
+ unless status_code == 200 || status_code == 202 || status_code == 204
276
+ error_model = JSON.load(response_content)
277
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
278
+ end
279
+
280
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
281
+
282
+ result
283
+ end
284
+
285
+ promise.execute
286
+ end
287
+
288
+ end
289
+ end
@@ -0,0 +1,735 @@
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::Hdinsight::Mgmt::V2018_06_01_preview
7
+ #
8
+ # HDInsight Management Client
9
+ #
10
+ class Extensions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Extensions class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [HDInsightManagementClient] reference to the HDInsightManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Enables the Operations Management Suite (OMS) on the HDInsight cluster.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param cluster_name [String] The name of the cluster.
29
+ # @param parameters [ClusterMonitoringRequest] The Operations Management Suite
30
+ # (OMS) workspace parameters.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ def enable_monitoring(resource_group_name, cluster_name, parameters, custom_headers:nil)
35
+ response = enable_monitoring_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
36
+ nil
37
+ end
38
+
39
+ #
40
+ # @param resource_group_name [String] The name of the resource group.
41
+ # @param cluster_name [String] The name of the cluster.
42
+ # @param parameters [ClusterMonitoringRequest] The Operations Management Suite
43
+ # (OMS) workspace parameters.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [Concurrent::Promise] promise which provides async access to http
48
+ # response.
49
+ #
50
+ def enable_monitoring_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
51
+ # Send request
52
+ promise = begin_enable_monitoring_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)
53
+
54
+ promise = promise.then do |response|
55
+ # Defining deserialization method.
56
+ deserialize_method = lambda do |parsed_response|
57
+ end
58
+
59
+ # Waiting for response.
60
+ @client.get_long_running_operation_result(response, deserialize_method)
61
+ end
62
+
63
+ promise
64
+ end
65
+
66
+ #
67
+ # Gets the status of Operations Management Suite (OMS) on the HDInsight
68
+ # cluster.
69
+ #
70
+ # @param resource_group_name [String] The name of the resource group.
71
+ # @param cluster_name [String] The name of the cluster.
72
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
73
+ # will be added to the HTTP request.
74
+ #
75
+ # @return [ClusterMonitoringResponse] operation results.
76
+ #
77
+ def get_monitoring_status(resource_group_name, cluster_name, custom_headers:nil)
78
+ response = get_monitoring_status_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
79
+ response.body unless response.nil?
80
+ end
81
+
82
+ #
83
+ # Gets the status of Operations Management Suite (OMS) on the HDInsight
84
+ # cluster.
85
+ #
86
+ # @param resource_group_name [String] The name of the resource group.
87
+ # @param cluster_name [String] The name of the cluster.
88
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
89
+ # will be added to the HTTP request.
90
+ #
91
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
92
+ #
93
+ def get_monitoring_status_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
94
+ get_monitoring_status_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
95
+ end
96
+
97
+ #
98
+ # Gets the status of Operations Management Suite (OMS) on the HDInsight
99
+ # cluster.
100
+ #
101
+ # @param resource_group_name [String] The name of the resource group.
102
+ # @param cluster_name [String] The name of the cluster.
103
+ # @param [Hash{String => String}] A hash of custom headers that will be added
104
+ # to the HTTP request.
105
+ #
106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
107
+ #
108
+ def get_monitoring_status_async(resource_group_name, cluster_name, custom_headers:nil)
109
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
110
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
111
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
112
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
113
+
114
+
115
+ request_headers = {}
116
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
117
+
118
+ # Set Headers
119
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
120
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
121
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'
122
+
123
+ request_url = @base_url || @client.base_url
124
+
125
+ options = {
126
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
127
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
128
+ query_params: {'api-version' => @client.api_version},
129
+ headers: request_headers.merge(custom_headers || {}),
130
+ base_url: request_url
131
+ }
132
+ promise = @client.make_request_async(:get, path_template, options)
133
+
134
+ promise = promise.then do |result|
135
+ http_response = result.response
136
+ status_code = http_response.status
137
+ response_content = http_response.body
138
+ unless status_code == 200
139
+ error_model = JSON.load(response_content)
140
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
141
+ end
142
+
143
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
144
+ # Deserialize Response
145
+ if status_code == 200
146
+ begin
147
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
148
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringResponse.mapper()
149
+ result.body = @client.deserialize(result_mapper, parsed_response)
150
+ rescue Exception => e
151
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
152
+ end
153
+ end
154
+
155
+ result
156
+ end
157
+
158
+ promise.execute
159
+ end
160
+
161
+ #
162
+ # Disables the Operations Management Suite (OMS) on the HDInsight cluster.
163
+ #
164
+ # @param resource_group_name [String] The name of the resource group.
165
+ # @param cluster_name [String] The name of the cluster.
166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
167
+ # will be added to the HTTP request.
168
+ #
169
+ def disable_monitoring(resource_group_name, cluster_name, custom_headers:nil)
170
+ response = disable_monitoring_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
171
+ nil
172
+ end
173
+
174
+ #
175
+ # @param resource_group_name [String] The name of the resource group.
176
+ # @param cluster_name [String] The name of the cluster.
177
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
178
+ # will be added to the HTTP request.
179
+ #
180
+ # @return [Concurrent::Promise] promise which provides async access to http
181
+ # response.
182
+ #
183
+ def disable_monitoring_async(resource_group_name, cluster_name, custom_headers:nil)
184
+ # Send request
185
+ promise = begin_disable_monitoring_async(resource_group_name, cluster_name, custom_headers:custom_headers)
186
+
187
+ promise = promise.then do |response|
188
+ # Defining deserialization method.
189
+ deserialize_method = lambda do |parsed_response|
190
+ end
191
+
192
+ # Waiting for response.
193
+ @client.get_long_running_operation_result(response, deserialize_method)
194
+ end
195
+
196
+ promise
197
+ end
198
+
199
+ #
200
+ # Creates an HDInsight cluster extension.
201
+ #
202
+ # @param resource_group_name [String] The name of the resource group.
203
+ # @param cluster_name [String] The name of the cluster.
204
+ # @param extension_name [String] The name of the cluster extension.
205
+ # @param parameters [Extension] The cluster extensions create request.
206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
207
+ # will be added to the HTTP request.
208
+ #
209
+ def create(resource_group_name, cluster_name, extension_name, parameters, custom_headers:nil)
210
+ response = create_async(resource_group_name, cluster_name, extension_name, parameters, custom_headers:custom_headers).value!
211
+ nil
212
+ end
213
+
214
+ #
215
+ # @param resource_group_name [String] The name of the resource group.
216
+ # @param cluster_name [String] The name of the cluster.
217
+ # @param extension_name [String] The name of the cluster extension.
218
+ # @param parameters [Extension] The cluster extensions create request.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [Concurrent::Promise] promise which provides async access to http
223
+ # response.
224
+ #
225
+ def create_async(resource_group_name, cluster_name, extension_name, parameters, custom_headers:nil)
226
+ # Send request
227
+ promise = begin_create_async(resource_group_name, cluster_name, extension_name, parameters, custom_headers:custom_headers)
228
+
229
+ promise = promise.then do |response|
230
+ # Defining deserialization method.
231
+ deserialize_method = lambda do |parsed_response|
232
+ end
233
+
234
+ # Waiting for response.
235
+ @client.get_long_running_operation_result(response, deserialize_method)
236
+ end
237
+
238
+ promise
239
+ end
240
+
241
+ #
242
+ # Gets the extension properties for the specified HDInsight cluster extension.
243
+ #
244
+ # @param resource_group_name [String] The name of the resource group.
245
+ # @param cluster_name [String] The name of the cluster.
246
+ # @param extension_name [String] The name of the cluster extension.
247
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
248
+ # will be added to the HTTP request.
249
+ #
250
+ # @return [Extension] operation results.
251
+ #
252
+ def get(resource_group_name, cluster_name, extension_name, custom_headers:nil)
253
+ response = get_async(resource_group_name, cluster_name, extension_name, custom_headers:custom_headers).value!
254
+ response.body unless response.nil?
255
+ end
256
+
257
+ #
258
+ # Gets the extension properties for the specified HDInsight cluster extension.
259
+ #
260
+ # @param resource_group_name [String] The name of the resource group.
261
+ # @param cluster_name [String] The name of the cluster.
262
+ # @param extension_name [String] The name of the cluster extension.
263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
264
+ # will be added to the HTTP request.
265
+ #
266
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
267
+ #
268
+ def get_with_http_info(resource_group_name, cluster_name, extension_name, custom_headers:nil)
269
+ get_async(resource_group_name, cluster_name, extension_name, custom_headers:custom_headers).value!
270
+ end
271
+
272
+ #
273
+ # Gets the extension properties for the specified HDInsight cluster extension.
274
+ #
275
+ # @param resource_group_name [String] The name of the resource group.
276
+ # @param cluster_name [String] The name of the cluster.
277
+ # @param extension_name [String] The name of the cluster extension.
278
+ # @param [Hash{String => String}] A hash of custom headers that will be added
279
+ # to the HTTP request.
280
+ #
281
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
282
+ #
283
+ def get_async(resource_group_name, cluster_name, extension_name, custom_headers:nil)
284
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
285
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
286
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
287
+ fail ArgumentError, 'extension_name is nil' if extension_name.nil?
288
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
289
+
290
+
291
+ request_headers = {}
292
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
293
+
294
+ # Set Headers
295
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
296
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
297
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'
298
+
299
+ request_url = @base_url || @client.base_url
300
+
301
+ options = {
302
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
303
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'extensionName' => extension_name},
304
+ query_params: {'api-version' => @client.api_version},
305
+ headers: request_headers.merge(custom_headers || {}),
306
+ base_url: request_url
307
+ }
308
+ promise = @client.make_request_async(:get, path_template, options)
309
+
310
+ promise = promise.then do |result|
311
+ http_response = result.response
312
+ status_code = http_response.status
313
+ response_content = http_response.body
314
+ unless status_code == 200
315
+ error_model = JSON.load(response_content)
316
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
317
+ end
318
+
319
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
320
+ # Deserialize Response
321
+ if status_code == 200
322
+ begin
323
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
324
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension.mapper()
325
+ result.body = @client.deserialize(result_mapper, parsed_response)
326
+ rescue Exception => e
327
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
328
+ end
329
+ end
330
+
331
+ result
332
+ end
333
+
334
+ promise.execute
335
+ end
336
+
337
+ #
338
+ # Deletes the specified extension for HDInsight cluster.
339
+ #
340
+ # @param resource_group_name [String] The name of the resource group.
341
+ # @param cluster_name [String] The name of the cluster.
342
+ # @param extension_name [String] The name of the cluster extension.
343
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
344
+ # will be added to the HTTP request.
345
+ #
346
+ def delete(resource_group_name, cluster_name, extension_name, custom_headers:nil)
347
+ response = delete_async(resource_group_name, cluster_name, extension_name, custom_headers:custom_headers).value!
348
+ nil
349
+ end
350
+
351
+ #
352
+ # @param resource_group_name [String] The name of the resource group.
353
+ # @param cluster_name [String] The name of the cluster.
354
+ # @param extension_name [String] The name of the cluster extension.
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
357
+ #
358
+ # @return [Concurrent::Promise] promise which provides async access to http
359
+ # response.
360
+ #
361
+ def delete_async(resource_group_name, cluster_name, extension_name, custom_headers:nil)
362
+ # Send request
363
+ promise = begin_delete_async(resource_group_name, cluster_name, extension_name, custom_headers:custom_headers)
364
+
365
+ promise = promise.then do |response|
366
+ # Defining deserialization method.
367
+ deserialize_method = lambda do |parsed_response|
368
+ end
369
+
370
+ # Waiting for response.
371
+ @client.get_long_running_operation_result(response, deserialize_method)
372
+ end
373
+
374
+ promise
375
+ end
376
+
377
+ #
378
+ # Enables the Operations Management Suite (OMS) on the HDInsight cluster.
379
+ #
380
+ # @param resource_group_name [String] The name of the resource group.
381
+ # @param cluster_name [String] The name of the cluster.
382
+ # @param parameters [ClusterMonitoringRequest] The Operations Management Suite
383
+ # (OMS) workspace parameters.
384
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
385
+ # will be added to the HTTP request.
386
+ #
387
+ #
388
+ def begin_enable_monitoring(resource_group_name, cluster_name, parameters, custom_headers:nil)
389
+ response = begin_enable_monitoring_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
390
+ nil
391
+ end
392
+
393
+ #
394
+ # Enables the Operations Management Suite (OMS) on the HDInsight cluster.
395
+ #
396
+ # @param resource_group_name [String] The name of the resource group.
397
+ # @param cluster_name [String] The name of the cluster.
398
+ # @param parameters [ClusterMonitoringRequest] The Operations Management Suite
399
+ # (OMS) workspace parameters.
400
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
401
+ # will be added to the HTTP request.
402
+ #
403
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
404
+ #
405
+ def begin_enable_monitoring_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
406
+ begin_enable_monitoring_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
407
+ end
408
+
409
+ #
410
+ # Enables the Operations Management Suite (OMS) on the HDInsight cluster.
411
+ #
412
+ # @param resource_group_name [String] The name of the resource group.
413
+ # @param cluster_name [String] The name of the cluster.
414
+ # @param parameters [ClusterMonitoringRequest] The Operations Management Suite
415
+ # (OMS) workspace parameters.
416
+ # @param [Hash{String => String}] A hash of custom headers that will be added
417
+ # to the HTTP request.
418
+ #
419
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
420
+ #
421
+ def begin_enable_monitoring_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
422
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
423
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
424
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
425
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
426
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
427
+
428
+
429
+ request_headers = {}
430
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
431
+
432
+ # Set Headers
433
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
434
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
435
+
436
+ # Serialize Request
437
+ request_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterMonitoringRequest.mapper()
438
+ request_content = @client.serialize(request_mapper, parameters)
439
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
440
+
441
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'
442
+
443
+ request_url = @base_url || @client.base_url
444
+
445
+ options = {
446
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
447
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
448
+ query_params: {'api-version' => @client.api_version},
449
+ body: request_content,
450
+ headers: request_headers.merge(custom_headers || {}),
451
+ base_url: request_url
452
+ }
453
+ promise = @client.make_request_async(:put, path_template, options)
454
+
455
+ promise = promise.then do |result|
456
+ http_response = result.response
457
+ status_code = http_response.status
458
+ response_content = http_response.body
459
+ unless status_code == 200 || status_code == 202
460
+ error_model = JSON.load(response_content)
461
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
462
+ end
463
+
464
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
465
+
466
+ result
467
+ end
468
+
469
+ promise.execute
470
+ end
471
+
472
+ #
473
+ # Disables the Operations Management Suite (OMS) on the HDInsight cluster.
474
+ #
475
+ # @param resource_group_name [String] The name of the resource group.
476
+ # @param cluster_name [String] The name of the cluster.
477
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
478
+ # will be added to the HTTP request.
479
+ #
480
+ #
481
+ def begin_disable_monitoring(resource_group_name, cluster_name, custom_headers:nil)
482
+ response = begin_disable_monitoring_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
483
+ nil
484
+ end
485
+
486
+ #
487
+ # Disables the Operations Management Suite (OMS) on the HDInsight cluster.
488
+ #
489
+ # @param resource_group_name [String] The name of the resource group.
490
+ # @param cluster_name [String] The name of the cluster.
491
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
492
+ # will be added to the HTTP request.
493
+ #
494
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
495
+ #
496
+ def begin_disable_monitoring_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
497
+ begin_disable_monitoring_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
498
+ end
499
+
500
+ #
501
+ # Disables the Operations Management Suite (OMS) on the HDInsight cluster.
502
+ #
503
+ # @param resource_group_name [String] The name of the resource group.
504
+ # @param cluster_name [String] The name of the cluster.
505
+ # @param [Hash{String => String}] A hash of custom headers that will be added
506
+ # to the HTTP request.
507
+ #
508
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
509
+ #
510
+ def begin_disable_monitoring_async(resource_group_name, cluster_name, custom_headers:nil)
511
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
512
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
513
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
514
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
515
+
516
+
517
+ request_headers = {}
518
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
519
+
520
+ # Set Headers
521
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
522
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
523
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'
524
+
525
+ request_url = @base_url || @client.base_url
526
+
527
+ options = {
528
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
529
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
530
+ query_params: {'api-version' => @client.api_version},
531
+ headers: request_headers.merge(custom_headers || {}),
532
+ base_url: request_url
533
+ }
534
+ promise = @client.make_request_async(:delete, path_template, options)
535
+
536
+ promise = promise.then do |result|
537
+ http_response = result.response
538
+ status_code = http_response.status
539
+ response_content = http_response.body
540
+ unless status_code == 200 || status_code == 202
541
+ error_model = JSON.load(response_content)
542
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
543
+ end
544
+
545
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
546
+
547
+ result
548
+ end
549
+
550
+ promise.execute
551
+ end
552
+
553
+ #
554
+ # Creates an HDInsight cluster extension.
555
+ #
556
+ # @param resource_group_name [String] The name of the resource group.
557
+ # @param cluster_name [String] The name of the cluster.
558
+ # @param extension_name [String] The name of the cluster extension.
559
+ # @param parameters [Extension] The cluster extensions create request.
560
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
561
+ # will be added to the HTTP request.
562
+ #
563
+ #
564
+ def begin_create(resource_group_name, cluster_name, extension_name, parameters, custom_headers:nil)
565
+ response = begin_create_async(resource_group_name, cluster_name, extension_name, parameters, custom_headers:custom_headers).value!
566
+ nil
567
+ end
568
+
569
+ #
570
+ # Creates an HDInsight cluster extension.
571
+ #
572
+ # @param resource_group_name [String] The name of the resource group.
573
+ # @param cluster_name [String] The name of the cluster.
574
+ # @param extension_name [String] The name of the cluster extension.
575
+ # @param parameters [Extension] The cluster extensions create request.
576
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
577
+ # will be added to the HTTP request.
578
+ #
579
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
580
+ #
581
+ def begin_create_with_http_info(resource_group_name, cluster_name, extension_name, parameters, custom_headers:nil)
582
+ begin_create_async(resource_group_name, cluster_name, extension_name, parameters, custom_headers:custom_headers).value!
583
+ end
584
+
585
+ #
586
+ # Creates an HDInsight cluster extension.
587
+ #
588
+ # @param resource_group_name [String] The name of the resource group.
589
+ # @param cluster_name [String] The name of the cluster.
590
+ # @param extension_name [String] The name of the cluster extension.
591
+ # @param parameters [Extension] The cluster extensions create request.
592
+ # @param [Hash{String => String}] A hash of custom headers that will be added
593
+ # to the HTTP request.
594
+ #
595
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
596
+ #
597
+ def begin_create_async(resource_group_name, cluster_name, extension_name, parameters, custom_headers:nil)
598
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
599
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
600
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
601
+ fail ArgumentError, 'extension_name is nil' if extension_name.nil?
602
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
603
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
604
+
605
+
606
+ request_headers = {}
607
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
608
+
609
+ # Set Headers
610
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
611
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
612
+
613
+ # Serialize Request
614
+ request_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Extension.mapper()
615
+ request_content = @client.serialize(request_mapper, parameters)
616
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
617
+
618
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'
619
+
620
+ request_url = @base_url || @client.base_url
621
+
622
+ options = {
623
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
624
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'extensionName' => extension_name},
625
+ query_params: {'api-version' => @client.api_version},
626
+ body: request_content,
627
+ headers: request_headers.merge(custom_headers || {}),
628
+ base_url: request_url
629
+ }
630
+ promise = @client.make_request_async(:put, path_template, options)
631
+
632
+ promise = promise.then do |result|
633
+ http_response = result.response
634
+ status_code = http_response.status
635
+ response_content = http_response.body
636
+ unless status_code == 200 || status_code == 202
637
+ error_model = JSON.load(response_content)
638
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
639
+ end
640
+
641
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
642
+
643
+ result
644
+ end
645
+
646
+ promise.execute
647
+ end
648
+
649
+ #
650
+ # Deletes the specified extension for HDInsight cluster.
651
+ #
652
+ # @param resource_group_name [String] The name of the resource group.
653
+ # @param cluster_name [String] The name of the cluster.
654
+ # @param extension_name [String] The name of the cluster extension.
655
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
656
+ # will be added to the HTTP request.
657
+ #
658
+ #
659
+ def begin_delete(resource_group_name, cluster_name, extension_name, custom_headers:nil)
660
+ response = begin_delete_async(resource_group_name, cluster_name, extension_name, custom_headers:custom_headers).value!
661
+ nil
662
+ end
663
+
664
+ #
665
+ # Deletes the specified extension for HDInsight cluster.
666
+ #
667
+ # @param resource_group_name [String] The name of the resource group.
668
+ # @param cluster_name [String] The name of the cluster.
669
+ # @param extension_name [String] The name of the cluster extension.
670
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
671
+ # will be added to the HTTP request.
672
+ #
673
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
674
+ #
675
+ def begin_delete_with_http_info(resource_group_name, cluster_name, extension_name, custom_headers:nil)
676
+ begin_delete_async(resource_group_name, cluster_name, extension_name, custom_headers:custom_headers).value!
677
+ end
678
+
679
+ #
680
+ # Deletes the specified extension for HDInsight cluster.
681
+ #
682
+ # @param resource_group_name [String] The name of the resource group.
683
+ # @param cluster_name [String] The name of the cluster.
684
+ # @param extension_name [String] The name of the cluster extension.
685
+ # @param [Hash{String => String}] A hash of custom headers that will be added
686
+ # to the HTTP request.
687
+ #
688
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
689
+ #
690
+ def begin_delete_async(resource_group_name, cluster_name, extension_name, custom_headers:nil)
691
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
692
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
693
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
694
+ fail ArgumentError, 'extension_name is nil' if extension_name.nil?
695
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
696
+
697
+
698
+ request_headers = {}
699
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
700
+
701
+ # Set Headers
702
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
703
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
704
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'
705
+
706
+ request_url = @base_url || @client.base_url
707
+
708
+ options = {
709
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
710
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'extensionName' => extension_name},
711
+ query_params: {'api-version' => @client.api_version},
712
+ headers: request_headers.merge(custom_headers || {}),
713
+ base_url: request_url
714
+ }
715
+ promise = @client.make_request_async(:delete, path_template, options)
716
+
717
+ promise = promise.then do |result|
718
+ http_response = result.response
719
+ status_code = http_response.status
720
+ response_content = http_response.body
721
+ unless status_code == 200 || status_code == 202
722
+ error_model = JSON.load(response_content)
723
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
724
+ end
725
+
726
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
727
+
728
+ result
729
+ end
730
+
731
+ promise.execute
732
+ end
733
+
734
+ end
735
+ end