azure_mgmt_hdinsight 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
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,1292 @@
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 Clusters
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Clusters 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
+ # Creates a new HDInsight cluster with the specified parameters.
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 [ClusterCreateParametersExtended] The cluster create
30
+ # request.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Cluster] operation results.
35
+ #
36
+ def create(resource_group_name, cluster_name, parameters, custom_headers:nil)
37
+ response = create_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # @param resource_group_name [String] The name of the resource group.
43
+ # @param cluster_name [String] The name of the cluster.
44
+ # @param parameters [ClusterCreateParametersExtended] The cluster create
45
+ # request.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [Concurrent::Promise] promise which provides async access to http
50
+ # response.
51
+ #
52
+ def create_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
53
+ # Send request
54
+ promise = begin_create_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)
55
+
56
+ promise = promise.then do |response|
57
+ # Defining deserialization method.
58
+ deserialize_method = lambda do |parsed_response|
59
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Cluster.mapper()
60
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
61
+ end
62
+
63
+ # Waiting for response.
64
+ @client.get_long_running_operation_result(response, deserialize_method)
65
+ end
66
+
67
+ promise
68
+ end
69
+
70
+ #
71
+ # Patch HDInsight cluster with the specified parameters.
72
+ #
73
+ # @param resource_group_name [String] The name of the resource group.
74
+ # @param cluster_name [String] The name of the cluster.
75
+ # @param parameters [ClusterPatchParameters] The cluster patch request.
76
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
77
+ # will be added to the HTTP request.
78
+ #
79
+ # @return [Cluster] operation results.
80
+ #
81
+ def update(resource_group_name, cluster_name, parameters, custom_headers:nil)
82
+ response = update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
83
+ response.body unless response.nil?
84
+ end
85
+
86
+ #
87
+ # Patch HDInsight cluster with the specified parameters.
88
+ #
89
+ # @param resource_group_name [String] The name of the resource group.
90
+ # @param cluster_name [String] The name of the cluster.
91
+ # @param parameters [ClusterPatchParameters] The cluster patch request.
92
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
93
+ # will be added to the HTTP request.
94
+ #
95
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
96
+ #
97
+ def update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
98
+ update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
99
+ end
100
+
101
+ #
102
+ # Patch HDInsight cluster with the specified parameters.
103
+ #
104
+ # @param resource_group_name [String] The name of the resource group.
105
+ # @param cluster_name [String] The name of the cluster.
106
+ # @param parameters [ClusterPatchParameters] The cluster patch request.
107
+ # @param [Hash{String => String}] A hash of custom headers that will be added
108
+ # to the HTTP request.
109
+ #
110
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
111
+ #
112
+ def update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
113
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
114
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
115
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
116
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
117
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
118
+
119
+
120
+ request_headers = {}
121
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
122
+
123
+ # Set Headers
124
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
125
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
126
+
127
+ # Serialize Request
128
+ request_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters.mapper()
129
+ request_content = @client.serialize(request_mapper, parameters)
130
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
131
+
132
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}'
133
+
134
+ request_url = @base_url || @client.base_url
135
+
136
+ options = {
137
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
138
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
139
+ query_params: {'api-version' => @client.api_version},
140
+ body: request_content,
141
+ headers: request_headers.merge(custom_headers || {}),
142
+ base_url: request_url
143
+ }
144
+ promise = @client.make_request_async(:patch, path_template, options)
145
+
146
+ promise = promise.then do |result|
147
+ http_response = result.response
148
+ status_code = http_response.status
149
+ response_content = http_response.body
150
+ unless status_code == 200
151
+ error_model = JSON.load(response_content)
152
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
153
+ end
154
+
155
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
156
+ # Deserialize Response
157
+ if status_code == 200
158
+ begin
159
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
160
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Cluster.mapper()
161
+ result.body = @client.deserialize(result_mapper, parsed_response)
162
+ rescue Exception => e
163
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
164
+ end
165
+ end
166
+
167
+ result
168
+ end
169
+
170
+ promise.execute
171
+ end
172
+
173
+ #
174
+ # Deletes the specified HDInsight cluster.
175
+ #
176
+ # @param resource_group_name [String] The name of the resource group.
177
+ # @param cluster_name [String] The name of the cluster.
178
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
179
+ # will be added to the HTTP request.
180
+ #
181
+ def delete(resource_group_name, cluster_name, custom_headers:nil)
182
+ response = delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
183
+ nil
184
+ end
185
+
186
+ #
187
+ # @param resource_group_name [String] The name of the resource group.
188
+ # @param cluster_name [String] The name of the cluster.
189
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
190
+ # will be added to the HTTP request.
191
+ #
192
+ # @return [Concurrent::Promise] promise which provides async access to http
193
+ # response.
194
+ #
195
+ def delete_async(resource_group_name, cluster_name, custom_headers:nil)
196
+ # Send request
197
+ promise = begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers)
198
+
199
+ promise = promise.then do |response|
200
+ # Defining deserialization method.
201
+ deserialize_method = lambda do |parsed_response|
202
+ end
203
+
204
+ # Waiting for response.
205
+ @client.get_long_running_operation_result(response, deserialize_method)
206
+ end
207
+
208
+ promise
209
+ end
210
+
211
+ #
212
+ # Gets the specified cluster.
213
+ #
214
+ # @param resource_group_name [String] The name of the resource group.
215
+ # @param cluster_name [String] The name of the cluster.
216
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
217
+ # will be added to the HTTP request.
218
+ #
219
+ # @return [Cluster] operation results.
220
+ #
221
+ def get(resource_group_name, cluster_name, custom_headers:nil)
222
+ response = get_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
223
+ response.body unless response.nil?
224
+ end
225
+
226
+ #
227
+ # Gets the specified cluster.
228
+ #
229
+ # @param resource_group_name [String] The name of the resource group.
230
+ # @param cluster_name [String] The name of the cluster.
231
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
232
+ # will be added to the HTTP request.
233
+ #
234
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
235
+ #
236
+ def get_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
237
+ get_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
238
+ end
239
+
240
+ #
241
+ # Gets the specified cluster.
242
+ #
243
+ # @param resource_group_name [String] The name of the resource group.
244
+ # @param cluster_name [String] The name of the cluster.
245
+ # @param [Hash{String => String}] A hash of custom headers that will be added
246
+ # to the HTTP request.
247
+ #
248
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
249
+ #
250
+ def get_async(resource_group_name, cluster_name, custom_headers:nil)
251
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
252
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
253
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
254
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
255
+
256
+
257
+ request_headers = {}
258
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
259
+
260
+ # Set Headers
261
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
262
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
263
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}'
264
+
265
+ request_url = @base_url || @client.base_url
266
+
267
+ options = {
268
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
269
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
270
+ query_params: {'api-version' => @client.api_version},
271
+ headers: request_headers.merge(custom_headers || {}),
272
+ base_url: request_url
273
+ }
274
+ promise = @client.make_request_async(:get, path_template, options)
275
+
276
+ promise = promise.then do |result|
277
+ http_response = result.response
278
+ status_code = http_response.status
279
+ response_content = http_response.body
280
+ unless status_code == 200
281
+ error_model = JSON.load(response_content)
282
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
283
+ end
284
+
285
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
286
+ # Deserialize Response
287
+ if status_code == 200
288
+ begin
289
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
290
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Cluster.mapper()
291
+ result.body = @client.deserialize(result_mapper, parsed_response)
292
+ rescue Exception => e
293
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
294
+ end
295
+ end
296
+
297
+ result
298
+ end
299
+
300
+ promise.execute
301
+ end
302
+
303
+ #
304
+ # Lists the HDInsight clusters in a resource group.
305
+ #
306
+ # @param resource_group_name [String] The name of the resource group.
307
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
308
+ # will be added to the HTTP request.
309
+ #
310
+ # @return [Array<Cluster>] operation results.
311
+ #
312
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
313
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
314
+ first_page.get_all_items
315
+ end
316
+
317
+ #
318
+ # Lists the HDInsight clusters in a resource group.
319
+ #
320
+ # @param resource_group_name [String] The name of the resource group.
321
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
322
+ # will be added to the HTTP request.
323
+ #
324
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
325
+ #
326
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
327
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
328
+ end
329
+
330
+ #
331
+ # Lists the HDInsight clusters in a resource group.
332
+ #
333
+ # @param resource_group_name [String] The name of the resource group.
334
+ # @param [Hash{String => String}] A hash of custom headers that will be added
335
+ # to the HTTP request.
336
+ #
337
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
338
+ #
339
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
340
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
341
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
342
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
343
+
344
+
345
+ request_headers = {}
346
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
347
+
348
+ # Set Headers
349
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
350
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
351
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters'
352
+
353
+ request_url = @base_url || @client.base_url
354
+
355
+ options = {
356
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
357
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
358
+ query_params: {'api-version' => @client.api_version},
359
+ headers: request_headers.merge(custom_headers || {}),
360
+ base_url: request_url
361
+ }
362
+ promise = @client.make_request_async(:get, path_template, options)
363
+
364
+ promise = promise.then do |result|
365
+ http_response = result.response
366
+ status_code = http_response.status
367
+ response_content = http_response.body
368
+ unless status_code == 200
369
+ error_model = JSON.load(response_content)
370
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
371
+ end
372
+
373
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
374
+ # Deserialize Response
375
+ if status_code == 200
376
+ begin
377
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
378
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult.mapper()
379
+ result.body = @client.deserialize(result_mapper, parsed_response)
380
+ rescue Exception => e
381
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
382
+ end
383
+ end
384
+
385
+ result
386
+ end
387
+
388
+ promise.execute
389
+ end
390
+
391
+ #
392
+ # Resizes the specified HDInsight cluster to the specified size.
393
+ #
394
+ # @param resource_group_name [String] The name of the resource group.
395
+ # @param cluster_name [String] The name of the cluster.
396
+ # @param parameters [ClusterResizeParameters] The parameters for the resize
397
+ # operation.
398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
399
+ # will be added to the HTTP request.
400
+ #
401
+ def resize(resource_group_name, cluster_name, parameters, custom_headers:nil)
402
+ response = resize_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
403
+ nil
404
+ end
405
+
406
+ #
407
+ # @param resource_group_name [String] The name of the resource group.
408
+ # @param cluster_name [String] The name of the cluster.
409
+ # @param parameters [ClusterResizeParameters] The parameters for the resize
410
+ # operation.
411
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
412
+ # will be added to the HTTP request.
413
+ #
414
+ # @return [Concurrent::Promise] promise which provides async access to http
415
+ # response.
416
+ #
417
+ def resize_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
418
+ # Send request
419
+ promise = begin_resize_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)
420
+
421
+ promise = promise.then do |response|
422
+ # Defining deserialization method.
423
+ deserialize_method = lambda do |parsed_response|
424
+ end
425
+
426
+ # Waiting for response.
427
+ @client.get_long_running_operation_result(response, deserialize_method)
428
+ end
429
+
430
+ promise
431
+ end
432
+
433
+ #
434
+ # Lists all the HDInsight clusters under the subscription.
435
+ #
436
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
437
+ # will be added to the HTTP request.
438
+ #
439
+ # @return [Array<Cluster>] operation results.
440
+ #
441
+ def list(custom_headers:nil)
442
+ first_page = list_as_lazy(custom_headers:custom_headers)
443
+ first_page.get_all_items
444
+ end
445
+
446
+ #
447
+ # Lists all the HDInsight clusters under the subscription.
448
+ #
449
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
450
+ # will be added to the HTTP request.
451
+ #
452
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
453
+ #
454
+ def list_with_http_info(custom_headers:nil)
455
+ list_async(custom_headers:custom_headers).value!
456
+ end
457
+
458
+ #
459
+ # Lists all the HDInsight clusters under the subscription.
460
+ #
461
+ # @param [Hash{String => String}] A hash of custom headers that will be added
462
+ # to the HTTP request.
463
+ #
464
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
465
+ #
466
+ def list_async(custom_headers:nil)
467
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
468
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
469
+
470
+
471
+ request_headers = {}
472
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
473
+
474
+ # Set Headers
475
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
476
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
477
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters'
478
+
479
+ request_url = @base_url || @client.base_url
480
+
481
+ options = {
482
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
483
+ path_params: {'subscriptionId' => @client.subscription_id},
484
+ query_params: {'api-version' => @client.api_version},
485
+ headers: request_headers.merge(custom_headers || {}),
486
+ base_url: request_url
487
+ }
488
+ promise = @client.make_request_async(:get, path_template, options)
489
+
490
+ promise = promise.then do |result|
491
+ http_response = result.response
492
+ status_code = http_response.status
493
+ response_content = http_response.body
494
+ unless status_code == 200
495
+ error_model = JSON.load(response_content)
496
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
497
+ end
498
+
499
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
500
+ # Deserialize Response
501
+ if status_code == 200
502
+ begin
503
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
504
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult.mapper()
505
+ result.body = @client.deserialize(result_mapper, parsed_response)
506
+ rescue Exception => e
507
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
508
+ end
509
+ end
510
+
511
+ result
512
+ end
513
+
514
+ promise.execute
515
+ end
516
+
517
+ #
518
+ # Rotate disk encryption key of the specified HDInsight cluster.
519
+ #
520
+ # @param resource_group_name [String] The name of the resource group.
521
+ # @param cluster_name [String] The name of the cluster.
522
+ # @param parameters [ClusterDiskEncryptionParameters] The parameters for the
523
+ # disk encryption operation.
524
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
525
+ # will be added to the HTTP request.
526
+ #
527
+ def rotate_disk_encryption_key(resource_group_name, cluster_name, parameters, custom_headers:nil)
528
+ response = rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
529
+ nil
530
+ end
531
+
532
+ #
533
+ # @param resource_group_name [String] The name of the resource group.
534
+ # @param cluster_name [String] The name of the cluster.
535
+ # @param parameters [ClusterDiskEncryptionParameters] The parameters for the
536
+ # disk encryption operation.
537
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
538
+ # will be added to the HTTP request.
539
+ #
540
+ # @return [Concurrent::Promise] promise which provides async access to http
541
+ # response.
542
+ #
543
+ def rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
544
+ # Send request
545
+ promise = begin_rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)
546
+
547
+ promise = promise.then do |response|
548
+ # Defining deserialization method.
549
+ deserialize_method = lambda do |parsed_response|
550
+ end
551
+
552
+ # Waiting for response.
553
+ @client.get_long_running_operation_result(response, deserialize_method)
554
+ end
555
+
556
+ promise
557
+ end
558
+
559
+ #
560
+ # Executes script actions on the specified HDInsight cluster.
561
+ #
562
+ # @param resource_group_name [String] The name of the resource group.
563
+ # @param cluster_name [String] The name of the cluster.
564
+ # @param parameters [ExecuteScriptActionParameters] The parameters for
565
+ # executing script actions.
566
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
567
+ # will be added to the HTTP request.
568
+ #
569
+ def execute_script_actions(resource_group_name, cluster_name, parameters, custom_headers:nil)
570
+ response = execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
571
+ nil
572
+ end
573
+
574
+ #
575
+ # @param resource_group_name [String] The name of the resource group.
576
+ # @param cluster_name [String] The name of the cluster.
577
+ # @param parameters [ExecuteScriptActionParameters] The parameters for
578
+ # executing script actions.
579
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
580
+ # will be added to the HTTP request.
581
+ #
582
+ # @return [Concurrent::Promise] promise which provides async access to http
583
+ # response.
584
+ #
585
+ def execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
586
+ # Send request
587
+ promise = begin_execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)
588
+
589
+ promise = promise.then do |response|
590
+ # Defining deserialization method.
591
+ deserialize_method = lambda do |parsed_response|
592
+ end
593
+
594
+ # Waiting for response.
595
+ @client.get_long_running_operation_result(response, deserialize_method)
596
+ end
597
+
598
+ promise
599
+ end
600
+
601
+ #
602
+ # Creates a new HDInsight cluster with the specified parameters.
603
+ #
604
+ # @param resource_group_name [String] The name of the resource group.
605
+ # @param cluster_name [String] The name of the cluster.
606
+ # @param parameters [ClusterCreateParametersExtended] The cluster create
607
+ # request.
608
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
609
+ # will be added to the HTTP request.
610
+ #
611
+ # @return [Cluster] operation results.
612
+ #
613
+ def begin_create(resource_group_name, cluster_name, parameters, custom_headers:nil)
614
+ response = begin_create_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
615
+ response.body unless response.nil?
616
+ end
617
+
618
+ #
619
+ # Creates a new HDInsight cluster with the specified parameters.
620
+ #
621
+ # @param resource_group_name [String] The name of the resource group.
622
+ # @param cluster_name [String] The name of the cluster.
623
+ # @param parameters [ClusterCreateParametersExtended] The cluster create
624
+ # request.
625
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
626
+ # will be added to the HTTP request.
627
+ #
628
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
629
+ #
630
+ def begin_create_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
631
+ begin_create_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
632
+ end
633
+
634
+ #
635
+ # Creates a new HDInsight cluster with the specified parameters.
636
+ #
637
+ # @param resource_group_name [String] The name of the resource group.
638
+ # @param cluster_name [String] The name of the cluster.
639
+ # @param parameters [ClusterCreateParametersExtended] The cluster create
640
+ # request.
641
+ # @param [Hash{String => String}] A hash of custom headers that will be added
642
+ # to the HTTP request.
643
+ #
644
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
645
+ #
646
+ def begin_create_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
647
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
648
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
649
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
650
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
651
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
652
+
653
+
654
+ request_headers = {}
655
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
656
+
657
+ # Set Headers
658
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
659
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
660
+
661
+ # Serialize Request
662
+ request_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended.mapper()
663
+ request_content = @client.serialize(request_mapper, parameters)
664
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
665
+
666
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}'
667
+
668
+ request_url = @base_url || @client.base_url
669
+
670
+ options = {
671
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
672
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
673
+ query_params: {'api-version' => @client.api_version},
674
+ body: request_content,
675
+ headers: request_headers.merge(custom_headers || {}),
676
+ base_url: request_url
677
+ }
678
+ promise = @client.make_request_async(:put, path_template, options)
679
+
680
+ promise = promise.then do |result|
681
+ http_response = result.response
682
+ status_code = http_response.status
683
+ response_content = http_response.body
684
+ unless status_code == 200
685
+ error_model = JSON.load(response_content)
686
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
687
+ end
688
+
689
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
690
+ # Deserialize Response
691
+ if status_code == 200
692
+ begin
693
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
694
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Cluster.mapper()
695
+ result.body = @client.deserialize(result_mapper, parsed_response)
696
+ rescue Exception => e
697
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
698
+ end
699
+ end
700
+
701
+ result
702
+ end
703
+
704
+ promise.execute
705
+ end
706
+
707
+ #
708
+ # Deletes the specified HDInsight cluster.
709
+ #
710
+ # @param resource_group_name [String] The name of the resource group.
711
+ # @param cluster_name [String] The name of the cluster.
712
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
713
+ # will be added to the HTTP request.
714
+ #
715
+ #
716
+ def begin_delete(resource_group_name, cluster_name, custom_headers:nil)
717
+ response = begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
718
+ nil
719
+ end
720
+
721
+ #
722
+ # Deletes the specified HDInsight cluster.
723
+ #
724
+ # @param resource_group_name [String] The name of the resource group.
725
+ # @param cluster_name [String] The name of the cluster.
726
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
727
+ # will be added to the HTTP request.
728
+ #
729
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
730
+ #
731
+ def begin_delete_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
732
+ begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
733
+ end
734
+
735
+ #
736
+ # Deletes the specified HDInsight cluster.
737
+ #
738
+ # @param resource_group_name [String] The name of the resource group.
739
+ # @param cluster_name [String] The name of the cluster.
740
+ # @param [Hash{String => String}] A hash of custom headers that will be added
741
+ # to the HTTP request.
742
+ #
743
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
744
+ #
745
+ def begin_delete_async(resource_group_name, cluster_name, custom_headers:nil)
746
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
747
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
748
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
749
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
750
+
751
+
752
+ request_headers = {}
753
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
754
+
755
+ # Set Headers
756
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
757
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
758
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}'
759
+
760
+ request_url = @base_url || @client.base_url
761
+
762
+ options = {
763
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
764
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
765
+ query_params: {'api-version' => @client.api_version},
766
+ headers: request_headers.merge(custom_headers || {}),
767
+ base_url: request_url
768
+ }
769
+ promise = @client.make_request_async(:delete, path_template, options)
770
+
771
+ promise = promise.then do |result|
772
+ http_response = result.response
773
+ status_code = http_response.status
774
+ response_content = http_response.body
775
+ unless status_code == 202 || status_code == 200
776
+ error_model = JSON.load(response_content)
777
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
778
+ end
779
+
780
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
781
+
782
+ result
783
+ end
784
+
785
+ promise.execute
786
+ end
787
+
788
+ #
789
+ # Resizes the specified HDInsight cluster to the specified size.
790
+ #
791
+ # @param resource_group_name [String] The name of the resource group.
792
+ # @param cluster_name [String] The name of the cluster.
793
+ # @param parameters [ClusterResizeParameters] The parameters for the resize
794
+ # operation.
795
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
796
+ # will be added to the HTTP request.
797
+ #
798
+ #
799
+ def begin_resize(resource_group_name, cluster_name, parameters, custom_headers:nil)
800
+ response = begin_resize_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
801
+ nil
802
+ end
803
+
804
+ #
805
+ # Resizes the specified HDInsight cluster to the specified size.
806
+ #
807
+ # @param resource_group_name [String] The name of the resource group.
808
+ # @param cluster_name [String] The name of the cluster.
809
+ # @param parameters [ClusterResizeParameters] The parameters for the resize
810
+ # operation.
811
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
812
+ # will be added to the HTTP request.
813
+ #
814
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
815
+ #
816
+ def begin_resize_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
817
+ begin_resize_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
818
+ end
819
+
820
+ #
821
+ # Resizes the specified HDInsight cluster to the specified size.
822
+ #
823
+ # @param resource_group_name [String] The name of the resource group.
824
+ # @param cluster_name [String] The name of the cluster.
825
+ # @param parameters [ClusterResizeParameters] The parameters for the resize
826
+ # operation.
827
+ # @param [Hash{String => String}] A hash of custom headers that will be added
828
+ # to the HTTP request.
829
+ #
830
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
831
+ #
832
+ def begin_resize_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
833
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
834
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
835
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
836
+ role_name = 'workernode'
837
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
838
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
839
+
840
+
841
+ request_headers = {}
842
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
843
+
844
+ # Set Headers
845
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
846
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
847
+
848
+ # Serialize Request
849
+ request_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters.mapper()
850
+ request_content = @client.serialize(request_mapper, parameters)
851
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
852
+
853
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize'
854
+
855
+ request_url = @base_url || @client.base_url
856
+
857
+ options = {
858
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
859
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'roleName' => role_name},
860
+ query_params: {'api-version' => @client.api_version},
861
+ body: request_content,
862
+ headers: request_headers.merge(custom_headers || {}),
863
+ base_url: request_url
864
+ }
865
+ promise = @client.make_request_async(:post, path_template, options)
866
+
867
+ promise = promise.then do |result|
868
+ http_response = result.response
869
+ status_code = http_response.status
870
+ response_content = http_response.body
871
+ unless status_code == 200 || status_code == 202
872
+ error_model = JSON.load(response_content)
873
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
874
+ end
875
+
876
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
877
+
878
+ result
879
+ end
880
+
881
+ promise.execute
882
+ end
883
+
884
+ #
885
+ # Rotate disk encryption key of the specified HDInsight cluster.
886
+ #
887
+ # @param resource_group_name [String] The name of the resource group.
888
+ # @param cluster_name [String] The name of the cluster.
889
+ # @param parameters [ClusterDiskEncryptionParameters] The parameters for the
890
+ # disk encryption operation.
891
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
892
+ # will be added to the HTTP request.
893
+ #
894
+ #
895
+ def begin_rotate_disk_encryption_key(resource_group_name, cluster_name, parameters, custom_headers:nil)
896
+ response = begin_rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
897
+ nil
898
+ end
899
+
900
+ #
901
+ # Rotate disk encryption key of the specified HDInsight cluster.
902
+ #
903
+ # @param resource_group_name [String] The name of the resource group.
904
+ # @param cluster_name [String] The name of the cluster.
905
+ # @param parameters [ClusterDiskEncryptionParameters] The parameters for the
906
+ # disk encryption operation.
907
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
908
+ # will be added to the HTTP request.
909
+ #
910
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
911
+ #
912
+ def begin_rotate_disk_encryption_key_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
913
+ begin_rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
914
+ end
915
+
916
+ #
917
+ # Rotate disk encryption key of the specified HDInsight cluster.
918
+ #
919
+ # @param resource_group_name [String] The name of the resource group.
920
+ # @param cluster_name [String] The name of the cluster.
921
+ # @param parameters [ClusterDiskEncryptionParameters] The parameters for the
922
+ # disk encryption operation.
923
+ # @param [Hash{String => String}] A hash of custom headers that will be added
924
+ # to the HTTP request.
925
+ #
926
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
927
+ #
928
+ def begin_rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
929
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
930
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
931
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
932
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
933
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
934
+
935
+
936
+ request_headers = {}
937
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
938
+
939
+ # Set Headers
940
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
941
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
942
+
943
+ # Serialize Request
944
+ request_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDiskEncryptionParameters.mapper()
945
+ request_content = @client.serialize(request_mapper, parameters)
946
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
947
+
948
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/rotatediskencryptionkey'
949
+
950
+ request_url = @base_url || @client.base_url
951
+
952
+ options = {
953
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
954
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
955
+ query_params: {'api-version' => @client.api_version},
956
+ body: request_content,
957
+ headers: request_headers.merge(custom_headers || {}),
958
+ base_url: request_url
959
+ }
960
+ promise = @client.make_request_async(:post, path_template, options)
961
+
962
+ promise = promise.then do |result|
963
+ http_response = result.response
964
+ status_code = http_response.status
965
+ response_content = http_response.body
966
+ unless status_code == 200 || status_code == 202
967
+ error_model = JSON.load(response_content)
968
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
969
+ end
970
+
971
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
972
+
973
+ result
974
+ end
975
+
976
+ promise.execute
977
+ end
978
+
979
+ #
980
+ # Executes script actions on the specified HDInsight cluster.
981
+ #
982
+ # @param resource_group_name [String] The name of the resource group.
983
+ # @param cluster_name [String] The name of the cluster.
984
+ # @param parameters [ExecuteScriptActionParameters] The parameters for
985
+ # executing script actions.
986
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
987
+ # will be added to the HTTP request.
988
+ #
989
+ #
990
+ def begin_execute_script_actions(resource_group_name, cluster_name, parameters, custom_headers:nil)
991
+ response = begin_execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
992
+ nil
993
+ end
994
+
995
+ #
996
+ # Executes script actions on the specified HDInsight cluster.
997
+ #
998
+ # @param resource_group_name [String] The name of the resource group.
999
+ # @param cluster_name [String] The name of the cluster.
1000
+ # @param parameters [ExecuteScriptActionParameters] The parameters for
1001
+ # executing script actions.
1002
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1003
+ # will be added to the HTTP request.
1004
+ #
1005
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1006
+ #
1007
+ def begin_execute_script_actions_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
1008
+ begin_execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
1009
+ end
1010
+
1011
+ #
1012
+ # Executes script actions on the specified HDInsight cluster.
1013
+ #
1014
+ # @param resource_group_name [String] The name of the resource group.
1015
+ # @param cluster_name [String] The name of the cluster.
1016
+ # @param parameters [ExecuteScriptActionParameters] The parameters for
1017
+ # executing script actions.
1018
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1019
+ # to the HTTP request.
1020
+ #
1021
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1022
+ #
1023
+ def begin_execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
1024
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1025
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1026
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
1027
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1028
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1029
+
1030
+
1031
+ request_headers = {}
1032
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1033
+
1034
+ # Set Headers
1035
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1036
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1037
+
1038
+ # Serialize Request
1039
+ request_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters.mapper()
1040
+ request_content = @client.serialize(request_mapper, parameters)
1041
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1042
+
1043
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions'
1044
+
1045
+ request_url = @base_url || @client.base_url
1046
+
1047
+ options = {
1048
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1049
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
1050
+ query_params: {'api-version' => @client.api_version},
1051
+ body: request_content,
1052
+ headers: request_headers.merge(custom_headers || {}),
1053
+ base_url: request_url
1054
+ }
1055
+ promise = @client.make_request_async(:post, path_template, options)
1056
+
1057
+ promise = promise.then do |result|
1058
+ http_response = result.response
1059
+ status_code = http_response.status
1060
+ response_content = http_response.body
1061
+ unless status_code == 202 || status_code == 200
1062
+ error_model = JSON.load(response_content)
1063
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1064
+ end
1065
+
1066
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1067
+
1068
+ result
1069
+ end
1070
+
1071
+ promise.execute
1072
+ end
1073
+
1074
+ #
1075
+ # Lists the HDInsight clusters in a resource group.
1076
+ #
1077
+ # @param next_page_link [String] The NextLink from the previous successful call
1078
+ # to List operation.
1079
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1080
+ # will be added to the HTTP request.
1081
+ #
1082
+ # @return [ClusterListResult] operation results.
1083
+ #
1084
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1085
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1086
+ response.body unless response.nil?
1087
+ end
1088
+
1089
+ #
1090
+ # Lists the HDInsight clusters in a resource group.
1091
+ #
1092
+ # @param next_page_link [String] The NextLink from the previous successful call
1093
+ # to List operation.
1094
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1095
+ # will be added to the HTTP request.
1096
+ #
1097
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1098
+ #
1099
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1100
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1101
+ end
1102
+
1103
+ #
1104
+ # Lists the HDInsight clusters in a resource group.
1105
+ #
1106
+ # @param next_page_link [String] The NextLink from the previous successful call
1107
+ # to List operation.
1108
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1109
+ # to the HTTP request.
1110
+ #
1111
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1112
+ #
1113
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1114
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1115
+
1116
+
1117
+ request_headers = {}
1118
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1119
+
1120
+ # Set Headers
1121
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1122
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1123
+ path_template = '{nextLink}'
1124
+
1125
+ request_url = @base_url || @client.base_url
1126
+
1127
+ options = {
1128
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1129
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1130
+ headers: request_headers.merge(custom_headers || {}),
1131
+ base_url: request_url
1132
+ }
1133
+ promise = @client.make_request_async(:get, path_template, options)
1134
+
1135
+ promise = promise.then do |result|
1136
+ http_response = result.response
1137
+ status_code = http_response.status
1138
+ response_content = http_response.body
1139
+ unless status_code == 200
1140
+ error_model = JSON.load(response_content)
1141
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1142
+ end
1143
+
1144
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1145
+ # Deserialize Response
1146
+ if status_code == 200
1147
+ begin
1148
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1149
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult.mapper()
1150
+ result.body = @client.deserialize(result_mapper, parsed_response)
1151
+ rescue Exception => e
1152
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1153
+ end
1154
+ end
1155
+
1156
+ result
1157
+ end
1158
+
1159
+ promise.execute
1160
+ end
1161
+
1162
+ #
1163
+ # Lists all the HDInsight clusters under the subscription.
1164
+ #
1165
+ # @param next_page_link [String] The NextLink from the previous successful call
1166
+ # to List operation.
1167
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1168
+ # will be added to the HTTP request.
1169
+ #
1170
+ # @return [ClusterListResult] operation results.
1171
+ #
1172
+ def list_next(next_page_link, custom_headers:nil)
1173
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1174
+ response.body unless response.nil?
1175
+ end
1176
+
1177
+ #
1178
+ # Lists all the HDInsight clusters under the subscription.
1179
+ #
1180
+ # @param next_page_link [String] The NextLink from the previous successful call
1181
+ # to List operation.
1182
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1183
+ # will be added to the HTTP request.
1184
+ #
1185
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1186
+ #
1187
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1188
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1189
+ end
1190
+
1191
+ #
1192
+ # Lists all the HDInsight clusters under the subscription.
1193
+ #
1194
+ # @param next_page_link [String] The NextLink from the previous successful call
1195
+ # to List operation.
1196
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1197
+ # to the HTTP request.
1198
+ #
1199
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1200
+ #
1201
+ def list_next_async(next_page_link, custom_headers:nil)
1202
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1203
+
1204
+
1205
+ request_headers = {}
1206
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1207
+
1208
+ # Set Headers
1209
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1210
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1211
+ path_template = '{nextLink}'
1212
+
1213
+ request_url = @base_url || @client.base_url
1214
+
1215
+ options = {
1216
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1217
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1218
+ headers: request_headers.merge(custom_headers || {}),
1219
+ base_url: request_url
1220
+ }
1221
+ promise = @client.make_request_async(:get, path_template, options)
1222
+
1223
+ promise = promise.then do |result|
1224
+ http_response = result.response
1225
+ status_code = http_response.status
1226
+ response_content = http_response.body
1227
+ unless status_code == 200
1228
+ error_model = JSON.load(response_content)
1229
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1230
+ end
1231
+
1232
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1233
+ # Deserialize Response
1234
+ if status_code == 200
1235
+ begin
1236
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1237
+ result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterListResult.mapper()
1238
+ result.body = @client.deserialize(result_mapper, parsed_response)
1239
+ rescue Exception => e
1240
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1241
+ end
1242
+ end
1243
+
1244
+ result
1245
+ end
1246
+
1247
+ promise.execute
1248
+ end
1249
+
1250
+ #
1251
+ # Lists the HDInsight clusters in a resource group.
1252
+ #
1253
+ # @param resource_group_name [String] The name of the resource group.
1254
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1255
+ # will be added to the HTTP request.
1256
+ #
1257
+ # @return [ClusterListResult] which provide lazy access to pages of the
1258
+ # response.
1259
+ #
1260
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1261
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1262
+ unless response.nil?
1263
+ page = response.body
1264
+ page.next_method = Proc.new do |next_page_link|
1265
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1266
+ end
1267
+ page
1268
+ end
1269
+ end
1270
+
1271
+ #
1272
+ # Lists all the HDInsight clusters under the subscription.
1273
+ #
1274
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1275
+ # will be added to the HTTP request.
1276
+ #
1277
+ # @return [ClusterListResult] which provide lazy access to pages of the
1278
+ # response.
1279
+ #
1280
+ def list_as_lazy(custom_headers:nil)
1281
+ response = list_async(custom_headers:custom_headers).value!
1282
+ unless response.nil?
1283
+ page = response.body
1284
+ page.next_method = Proc.new do |next_page_link|
1285
+ list_next_async(next_page_link, custom_headers:custom_headers)
1286
+ end
1287
+ page
1288
+ end
1289
+ end
1290
+
1291
+ end
1292
+ end