azure_mgmt_kusto 0.17.0 → 0.17.1

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