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
@@ -0,0 +1,836 @@
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 DataConnections
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the DataConnections 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
+ # Returns the list of data connections of the given Kusto database.
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 database_name [String] The name of the database in the Kusto cluster.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [DataConnectionListResult] operation results.
37
+ #
38
+ def list_by_database(resource_group_name, cluster_name, database_name, custom_headers:nil)
39
+ response = list_by_database_async(resource_group_name, cluster_name, database_name, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Returns the list of data connections of the given Kusto database.
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group containing
47
+ # the Kusto cluster.
48
+ # @param cluster_name [String] The name of the Kusto cluster.
49
+ # @param database_name [String] The name of the database in the Kusto cluster.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def list_by_database_with_http_info(resource_group_name, cluster_name, database_name, custom_headers:nil)
56
+ list_by_database_async(resource_group_name, cluster_name, database_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Returns the list of data connections of the given Kusto database.
61
+ #
62
+ # @param resource_group_name [String] The name of the resource group containing
63
+ # the Kusto cluster.
64
+ # @param cluster_name [String] The name of the Kusto cluster.
65
+ # @param database_name [String] The name of the database in the Kusto cluster.
66
+ # @param [Hash{String => String}] A hash of custom headers that will be added
67
+ # to the HTTP request.
68
+ #
69
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
70
+ #
71
+ def list_by_database_async(resource_group_name, cluster_name, database_name, custom_headers:nil)
72
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
73
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
74
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
75
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ # Deserialize Response
109
+ if status_code == 200
110
+ begin
111
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnectionListResult.mapper()
113
+ result.body = @client.deserialize(result_mapper, parsed_response)
114
+ rescue Exception => e
115
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
+ end
117
+ end
118
+
119
+ result
120
+ end
121
+
122
+ promise.execute
123
+ end
124
+
125
+ #
126
+ # Checks that the data connection parameters are valid.
127
+ #
128
+ # @param resource_group_name [String] The name of the resource group containing
129
+ # the Kusto cluster.
130
+ # @param cluster_name [String] The name of the Kusto cluster.
131
+ # @param database_name [String] The name of the database in the Kusto cluster.
132
+ # @param parameters [DataConnectionValidation] The data connection parameters
133
+ # supplied to the CreateOrUpdate operation.
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [DataConnectionValidationListResult] operation results.
138
+ #
139
+ def data_connection_validation_method(resource_group_name, cluster_name, database_name, parameters, custom_headers:nil)
140
+ response = data_connection_validation_method_async(resource_group_name, cluster_name, database_name, parameters, custom_headers:custom_headers).value!
141
+ response.body unless response.nil?
142
+ end
143
+
144
+ #
145
+ # Checks that the data connection parameters are valid.
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group containing
148
+ # the Kusto cluster.
149
+ # @param cluster_name [String] The name of the Kusto cluster.
150
+ # @param database_name [String] The name of the database in the Kusto cluster.
151
+ # @param parameters [DataConnectionValidation] The data connection parameters
152
+ # supplied to the CreateOrUpdate operation.
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
157
+ #
158
+ def data_connection_validation_method_with_http_info(resource_group_name, cluster_name, database_name, parameters, custom_headers:nil)
159
+ data_connection_validation_method_async(resource_group_name, cluster_name, database_name, parameters, custom_headers:custom_headers).value!
160
+ end
161
+
162
+ #
163
+ # Checks that the data connection parameters are valid.
164
+ #
165
+ # @param resource_group_name [String] The name of the resource group containing
166
+ # the Kusto cluster.
167
+ # @param cluster_name [String] The name of the Kusto cluster.
168
+ # @param database_name [String] The name of the database in the Kusto cluster.
169
+ # @param parameters [DataConnectionValidation] The data connection parameters
170
+ # supplied to the CreateOrUpdate operation.
171
+ # @param [Hash{String => String}] A hash of custom headers that will be added
172
+ # to the HTTP request.
173
+ #
174
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
175
+ #
176
+ def data_connection_validation_method_async(resource_group_name, cluster_name, database_name, parameters, custom_headers:nil)
177
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
178
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
179
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
180
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
181
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
182
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
183
+
184
+
185
+ request_headers = {}
186
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
187
+
188
+ # Set Headers
189
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
190
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
191
+
192
+ # Serialize Request
193
+ request_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnectionValidation.mapper()
194
+ request_content = @client.serialize(request_mapper, parameters)
195
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
196
+
197
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'
198
+
199
+ request_url = @base_url || @client.base_url
200
+
201
+ options = {
202
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
203
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
204
+ query_params: {'api-version' => @client.api_version},
205
+ body: request_content,
206
+ headers: request_headers.merge(custom_headers || {}),
207
+ base_url: request_url
208
+ }
209
+ promise = @client.make_request_async(:post, path_template, options)
210
+
211
+ promise = promise.then do |result|
212
+ http_response = result.response
213
+ status_code = http_response.status
214
+ response_content = http_response.body
215
+ unless status_code == 200
216
+ error_model = JSON.load(response_content)
217
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
218
+ end
219
+
220
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
221
+ # Deserialize Response
222
+ if status_code == 200
223
+ begin
224
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
225
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnectionValidationListResult.mapper()
226
+ result.body = @client.deserialize(result_mapper, parsed_response)
227
+ rescue Exception => e
228
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
229
+ end
230
+ end
231
+
232
+ result
233
+ end
234
+
235
+ promise.execute
236
+ end
237
+
238
+ #
239
+ # Returns a data connection.
240
+ #
241
+ # @param resource_group_name [String] The name of the resource group containing
242
+ # the Kusto cluster.
243
+ # @param cluster_name [String] The name of the Kusto cluster.
244
+ # @param database_name [String] The name of the database in the Kusto cluster.
245
+ # @param data_connection_name [String] The name of the data connection.
246
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
247
+ # will be added to the HTTP request.
248
+ #
249
+ # @return [DataConnection] operation results.
250
+ #
251
+ def get(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:nil)
252
+ response = get_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:custom_headers).value!
253
+ response.body unless response.nil?
254
+ end
255
+
256
+ #
257
+ # Returns a data connection.
258
+ #
259
+ # @param resource_group_name [String] The name of the resource group containing
260
+ # the Kusto cluster.
261
+ # @param cluster_name [String] The name of the Kusto cluster.
262
+ # @param database_name [String] The name of the database in the Kusto cluster.
263
+ # @param data_connection_name [String] The name of the data connection.
264
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
265
+ # will be added to the HTTP request.
266
+ #
267
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
268
+ #
269
+ def get_with_http_info(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:nil)
270
+ get_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:custom_headers).value!
271
+ end
272
+
273
+ #
274
+ # Returns a data connection.
275
+ #
276
+ # @param resource_group_name [String] The name of the resource group containing
277
+ # the Kusto cluster.
278
+ # @param cluster_name [String] The name of the Kusto cluster.
279
+ # @param database_name [String] The name of the database in the Kusto cluster.
280
+ # @param data_connection_name [String] The name of the data connection.
281
+ # @param [Hash{String => String}] A hash of custom headers that will be added
282
+ # to the HTTP request.
283
+ #
284
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
285
+ #
286
+ def get_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:nil)
287
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
288
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
289
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
290
+ fail ArgumentError, 'data_connection_name is nil' if data_connection_name.nil?
291
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
292
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
293
+
294
+
295
+ request_headers = {}
296
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
297
+
298
+ # Set Headers
299
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
300
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
301
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'
302
+
303
+ request_url = @base_url || @client.base_url
304
+
305
+ options = {
306
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
307
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'dataConnectionName' => data_connection_name,'subscriptionId' => @client.subscription_id},
308
+ query_params: {'api-version' => @client.api_version},
309
+ headers: request_headers.merge(custom_headers || {}),
310
+ base_url: request_url
311
+ }
312
+ promise = @client.make_request_async(:get, path_template, options)
313
+
314
+ promise = promise.then do |result|
315
+ http_response = result.response
316
+ status_code = http_response.status
317
+ response_content = http_response.body
318
+ unless status_code == 200
319
+ error_model = JSON.load(response_content)
320
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
321
+ end
322
+
323
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
324
+ # Deserialize Response
325
+ if status_code == 200
326
+ begin
327
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
328
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
329
+ result.body = @client.deserialize(result_mapper, parsed_response)
330
+ rescue Exception => e
331
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
332
+ end
333
+ end
334
+
335
+ result
336
+ end
337
+
338
+ promise.execute
339
+ end
340
+
341
+ #
342
+ # Creates or updates a data connection.
343
+ #
344
+ # @param resource_group_name [String] The name of the resource group containing
345
+ # the Kusto cluster.
346
+ # @param cluster_name [String] The name of the Kusto cluster.
347
+ # @param database_name [String] The name of the database in the Kusto cluster.
348
+ # @param data_connection_name [String] The name of the data connection.
349
+ # @param parameters [DataConnection] The data connection parameters supplied to
350
+ # the CreateOrUpdate operation.
351
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
352
+ # will be added to the HTTP request.
353
+ #
354
+ # @return [DataConnection] operation results.
355
+ #
356
+ def create_or_update(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
357
+ response = create_or_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:custom_headers).value!
358
+ response.body unless response.nil?
359
+ end
360
+
361
+ #
362
+ # @param resource_group_name [String] The name of the resource group containing
363
+ # the Kusto cluster.
364
+ # @param cluster_name [String] The name of the Kusto cluster.
365
+ # @param database_name [String] The name of the database in the Kusto cluster.
366
+ # @param data_connection_name [String] The name of the data connection.
367
+ # @param parameters [DataConnection] The data connection parameters supplied to
368
+ # the CreateOrUpdate operation.
369
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
370
+ # will be added to the HTTP request.
371
+ #
372
+ # @return [Concurrent::Promise] promise which provides async access to http
373
+ # response.
374
+ #
375
+ def create_or_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
376
+ # Send request
377
+ promise = begin_create_or_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:custom_headers)
378
+
379
+ promise = promise.then do |response|
380
+ # Defining deserialization method.
381
+ deserialize_method = lambda do |parsed_response|
382
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
383
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
384
+ end
385
+
386
+ # Waiting for response.
387
+ @client.get_long_running_operation_result(response, deserialize_method)
388
+ end
389
+
390
+ promise
391
+ end
392
+
393
+ #
394
+ # Updates a data connection.
395
+ #
396
+ # @param resource_group_name [String] The name of the resource group containing
397
+ # the Kusto cluster.
398
+ # @param cluster_name [String] The name of the Kusto cluster.
399
+ # @param database_name [String] The name of the database in the Kusto cluster.
400
+ # @param data_connection_name [String] The name of the data connection.
401
+ # @param parameters [DataConnection] The data connection parameters supplied to
402
+ # the Update operation.
403
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
404
+ # will be added to the HTTP request.
405
+ #
406
+ # @return [DataConnection] operation results.
407
+ #
408
+ def update(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
409
+ response = update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:custom_headers).value!
410
+ response.body unless response.nil?
411
+ end
412
+
413
+ #
414
+ # @param resource_group_name [String] The name of the resource group containing
415
+ # the Kusto cluster.
416
+ # @param cluster_name [String] The name of the Kusto cluster.
417
+ # @param database_name [String] The name of the database in the Kusto cluster.
418
+ # @param data_connection_name [String] The name of the data connection.
419
+ # @param parameters [DataConnection] The data connection parameters supplied to
420
+ # the Update operation.
421
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
422
+ # will be added to the HTTP request.
423
+ #
424
+ # @return [Concurrent::Promise] promise which provides async access to http
425
+ # response.
426
+ #
427
+ def update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
428
+ # Send request
429
+ promise = begin_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:custom_headers)
430
+
431
+ promise = promise.then do |response|
432
+ # Defining deserialization method.
433
+ deserialize_method = lambda do |parsed_response|
434
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
435
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
436
+ end
437
+
438
+ # Waiting for response.
439
+ @client.get_long_running_operation_result(response, deserialize_method)
440
+ end
441
+
442
+ promise
443
+ end
444
+
445
+ #
446
+ # Deletes the data connection with the given name.
447
+ #
448
+ # @param resource_group_name [String] The name of the resource group containing
449
+ # the Kusto cluster.
450
+ # @param cluster_name [String] The name of the Kusto cluster.
451
+ # @param database_name [String] The name of the database in the Kusto cluster.
452
+ # @param data_connection_name [String] The name of the data connection.
453
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
454
+ # will be added to the HTTP request.
455
+ #
456
+ def delete(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:nil)
457
+ response = delete_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:custom_headers).value!
458
+ nil
459
+ end
460
+
461
+ #
462
+ # @param resource_group_name [String] The name of the resource group containing
463
+ # the Kusto cluster.
464
+ # @param cluster_name [String] The name of the Kusto cluster.
465
+ # @param database_name [String] The name of the database in the Kusto cluster.
466
+ # @param data_connection_name [String] The name of the data connection.
467
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
468
+ # will be added to the HTTP request.
469
+ #
470
+ # @return [Concurrent::Promise] promise which provides async access to http
471
+ # response.
472
+ #
473
+ def delete_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:nil)
474
+ # Send request
475
+ promise = begin_delete_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:custom_headers)
476
+
477
+ promise = promise.then do |response|
478
+ # Defining deserialization method.
479
+ deserialize_method = lambda do |parsed_response|
480
+ end
481
+
482
+ # Waiting for response.
483
+ @client.get_long_running_operation_result(response, deserialize_method)
484
+ end
485
+
486
+ promise
487
+ end
488
+
489
+ #
490
+ # Creates or updates a data connection.
491
+ #
492
+ # @param resource_group_name [String] The name of the resource group containing
493
+ # the Kusto cluster.
494
+ # @param cluster_name [String] The name of the Kusto cluster.
495
+ # @param database_name [String] The name of the database in the Kusto cluster.
496
+ # @param data_connection_name [String] The name of the data connection.
497
+ # @param parameters [DataConnection] The data connection parameters supplied to
498
+ # the CreateOrUpdate operation.
499
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
500
+ # will be added to the HTTP request.
501
+ #
502
+ # @return [DataConnection] operation results.
503
+ #
504
+ def begin_create_or_update(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
505
+ response = begin_create_or_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:custom_headers).value!
506
+ response.body unless response.nil?
507
+ end
508
+
509
+ #
510
+ # Creates or updates a data connection.
511
+ #
512
+ # @param resource_group_name [String] The name of the resource group containing
513
+ # the Kusto cluster.
514
+ # @param cluster_name [String] The name of the Kusto cluster.
515
+ # @param database_name [String] The name of the database in the Kusto cluster.
516
+ # @param data_connection_name [String] The name of the data connection.
517
+ # @param parameters [DataConnection] The data connection parameters supplied to
518
+ # the CreateOrUpdate operation.
519
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
520
+ # will be added to the HTTP request.
521
+ #
522
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
523
+ #
524
+ def begin_create_or_update_with_http_info(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
525
+ begin_create_or_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:custom_headers).value!
526
+ end
527
+
528
+ #
529
+ # Creates or updates a data connection.
530
+ #
531
+ # @param resource_group_name [String] The name of the resource group containing
532
+ # the Kusto cluster.
533
+ # @param cluster_name [String] The name of the Kusto cluster.
534
+ # @param database_name [String] The name of the database in the Kusto cluster.
535
+ # @param data_connection_name [String] The name of the data connection.
536
+ # @param parameters [DataConnection] The data connection parameters supplied to
537
+ # the CreateOrUpdate operation.
538
+ # @param [Hash{String => String}] A hash of custom headers that will be added
539
+ # to the HTTP request.
540
+ #
541
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
542
+ #
543
+ def begin_create_or_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
544
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
545
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
546
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
547
+ fail ArgumentError, 'data_connection_name is nil' if data_connection_name.nil?
548
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
549
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
550
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
551
+
552
+
553
+ request_headers = {}
554
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
555
+
556
+ # Set Headers
557
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
558
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
559
+
560
+ # Serialize Request
561
+ request_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
562
+ request_content = @client.serialize(request_mapper, parameters)
563
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
564
+
565
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'
566
+
567
+ request_url = @base_url || @client.base_url
568
+
569
+ options = {
570
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
571
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'dataConnectionName' => data_connection_name,'subscriptionId' => @client.subscription_id},
572
+ query_params: {'api-version' => @client.api_version},
573
+ body: request_content,
574
+ headers: request_headers.merge(custom_headers || {}),
575
+ base_url: request_url
576
+ }
577
+ promise = @client.make_request_async(:put, path_template, options)
578
+
579
+ promise = promise.then do |result|
580
+ http_response = result.response
581
+ status_code = http_response.status
582
+ response_content = http_response.body
583
+ unless status_code == 200 || status_code == 201 || status_code == 202
584
+ error_model = JSON.load(response_content)
585
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
586
+ end
587
+
588
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
589
+ # Deserialize Response
590
+ if status_code == 200
591
+ begin
592
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
593
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
594
+ result.body = @client.deserialize(result_mapper, parsed_response)
595
+ rescue Exception => e
596
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
597
+ end
598
+ end
599
+ # Deserialize Response
600
+ if status_code == 201
601
+ begin
602
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
603
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
604
+ result.body = @client.deserialize(result_mapper, parsed_response)
605
+ rescue Exception => e
606
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
607
+ end
608
+ end
609
+
610
+ result
611
+ end
612
+
613
+ promise.execute
614
+ end
615
+
616
+ #
617
+ # Updates a data connection.
618
+ #
619
+ # @param resource_group_name [String] The name of the resource group containing
620
+ # the Kusto cluster.
621
+ # @param cluster_name [String] The name of the Kusto cluster.
622
+ # @param database_name [String] The name of the database in the Kusto cluster.
623
+ # @param data_connection_name [String] The name of the data connection.
624
+ # @param parameters [DataConnection] The data connection parameters supplied to
625
+ # the Update operation.
626
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
627
+ # will be added to the HTTP request.
628
+ #
629
+ # @return [DataConnection] operation results.
630
+ #
631
+ def begin_update(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
632
+ response = begin_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:custom_headers).value!
633
+ response.body unless response.nil?
634
+ end
635
+
636
+ #
637
+ # Updates a data connection.
638
+ #
639
+ # @param resource_group_name [String] The name of the resource group containing
640
+ # the Kusto cluster.
641
+ # @param cluster_name [String] The name of the Kusto cluster.
642
+ # @param database_name [String] The name of the database in the Kusto cluster.
643
+ # @param data_connection_name [String] The name of the data connection.
644
+ # @param parameters [DataConnection] The data connection parameters supplied to
645
+ # the Update operation.
646
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
647
+ # will be added to the HTTP request.
648
+ #
649
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
650
+ #
651
+ def begin_update_with_http_info(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
652
+ begin_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:custom_headers).value!
653
+ end
654
+
655
+ #
656
+ # Updates a data connection.
657
+ #
658
+ # @param resource_group_name [String] The name of the resource group containing
659
+ # the Kusto cluster.
660
+ # @param cluster_name [String] The name of the Kusto cluster.
661
+ # @param database_name [String] The name of the database in the Kusto cluster.
662
+ # @param data_connection_name [String] The name of the data connection.
663
+ # @param parameters [DataConnection] The data connection parameters supplied to
664
+ # the Update operation.
665
+ # @param [Hash{String => String}] A hash of custom headers that will be added
666
+ # to the HTTP request.
667
+ #
668
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
669
+ #
670
+ def begin_update_async(resource_group_name, cluster_name, database_name, data_connection_name, parameters, custom_headers:nil)
671
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
672
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
673
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
674
+ fail ArgumentError, 'data_connection_name is nil' if data_connection_name.nil?
675
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
676
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
677
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
678
+
679
+
680
+ request_headers = {}
681
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
682
+
683
+ # Set Headers
684
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
685
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
686
+
687
+ # Serialize Request
688
+ request_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
689
+ request_content = @client.serialize(request_mapper, parameters)
690
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
691
+
692
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'
693
+
694
+ request_url = @base_url || @client.base_url
695
+
696
+ options = {
697
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
698
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'dataConnectionName' => data_connection_name,'subscriptionId' => @client.subscription_id},
699
+ query_params: {'api-version' => @client.api_version},
700
+ body: request_content,
701
+ headers: request_headers.merge(custom_headers || {}),
702
+ base_url: request_url
703
+ }
704
+ promise = @client.make_request_async(:patch, path_template, options)
705
+
706
+ promise = promise.then do |result|
707
+ http_response = result.response
708
+ status_code = http_response.status
709
+ response_content = http_response.body
710
+ unless status_code == 200 || status_code == 201 || status_code == 202
711
+ error_model = JSON.load(response_content)
712
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
713
+ end
714
+
715
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
716
+ # Deserialize Response
717
+ if status_code == 200
718
+ begin
719
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
720
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
721
+ result.body = @client.deserialize(result_mapper, parsed_response)
722
+ rescue Exception => e
723
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
724
+ end
725
+ end
726
+ # Deserialize Response
727
+ if status_code == 201
728
+ begin
729
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
730
+ result_mapper = Azure::Kusto::Mgmt::V2019_01_21::Models::DataConnection.mapper()
731
+ result.body = @client.deserialize(result_mapper, parsed_response)
732
+ rescue Exception => e
733
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
734
+ end
735
+ end
736
+
737
+ result
738
+ end
739
+
740
+ promise.execute
741
+ end
742
+
743
+ #
744
+ # Deletes the data connection with the given name.
745
+ #
746
+ # @param resource_group_name [String] The name of the resource group containing
747
+ # the Kusto cluster.
748
+ # @param cluster_name [String] The name of the Kusto cluster.
749
+ # @param database_name [String] The name of the database in the Kusto cluster.
750
+ # @param data_connection_name [String] The name of the data connection.
751
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
752
+ # will be added to the HTTP request.
753
+ #
754
+ #
755
+ def begin_delete(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:nil)
756
+ response = begin_delete_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:custom_headers).value!
757
+ nil
758
+ end
759
+
760
+ #
761
+ # Deletes the data connection with the given name.
762
+ #
763
+ # @param resource_group_name [String] The name of the resource group containing
764
+ # the Kusto cluster.
765
+ # @param cluster_name [String] The name of the Kusto cluster.
766
+ # @param database_name [String] The name of the database in the Kusto cluster.
767
+ # @param data_connection_name [String] The name of the data connection.
768
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
769
+ # will be added to the HTTP request.
770
+ #
771
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
772
+ #
773
+ def begin_delete_with_http_info(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:nil)
774
+ begin_delete_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:custom_headers).value!
775
+ end
776
+
777
+ #
778
+ # Deletes the data connection with the given name.
779
+ #
780
+ # @param resource_group_name [String] The name of the resource group containing
781
+ # the Kusto cluster.
782
+ # @param cluster_name [String] The name of the Kusto cluster.
783
+ # @param database_name [String] The name of the database in the Kusto cluster.
784
+ # @param data_connection_name [String] The name of the data connection.
785
+ # @param [Hash{String => String}] A hash of custom headers that will be added
786
+ # to the HTTP request.
787
+ #
788
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
789
+ #
790
+ def begin_delete_async(resource_group_name, cluster_name, database_name, data_connection_name, custom_headers:nil)
791
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
792
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
793
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
794
+ fail ArgumentError, 'data_connection_name is nil' if data_connection_name.nil?
795
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
796
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
797
+
798
+
799
+ request_headers = {}
800
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
801
+
802
+ # Set Headers
803
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
804
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
805
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'
806
+
807
+ request_url = @base_url || @client.base_url
808
+
809
+ options = {
810
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
811
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'dataConnectionName' => data_connection_name,'subscriptionId' => @client.subscription_id},
812
+ query_params: {'api-version' => @client.api_version},
813
+ headers: request_headers.merge(custom_headers || {}),
814
+ base_url: request_url
815
+ }
816
+ promise = @client.make_request_async(:delete, path_template, options)
817
+
818
+ promise = promise.then do |result|
819
+ http_response = result.response
820
+ status_code = http_response.status
821
+ response_content = http_response.body
822
+ unless status_code == 200 || status_code == 202 || status_code == 204
823
+ error_model = JSON.load(response_content)
824
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
825
+ end
826
+
827
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
828
+
829
+ result
830
+ end
831
+
832
+ promise.execute
833
+ end
834
+
835
+ end
836
+ end