azure_mgmt_operational_insights 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_operational_insights.rb +8 -0
  4. data/lib/generated/azure_mgmt_operational_insights.rb +72 -0
  5. data/lib/generated/azure_mgmt_operational_insights/data_sources.rb +567 -0
  6. data/lib/generated/azure_mgmt_operational_insights/linked_services.rb +440 -0
  7. data/lib/generated/azure_mgmt_operational_insights/models/core_summary.rb +54 -0
  8. data/lib/generated/azure_mgmt_operational_insights/models/data_source.rb +108 -0
  9. data/lib/generated/azure_mgmt_operational_insights/models/data_source_filter.rb +49 -0
  10. data/lib/generated/azure_mgmt_operational_insights/models/data_source_kind.rb +29 -0
  11. data/lib/generated/azure_mgmt_operational_insights/models/data_source_list_result.rb +94 -0
  12. data/lib/generated/azure_mgmt_operational_insights/models/entity_status.rb +20 -0
  13. data/lib/generated/azure_mgmt_operational_insights/models/intelligence_pack.rb +55 -0
  14. data/lib/generated/azure_mgmt_operational_insights/models/link_target.rb +74 -0
  15. data/lib/generated/azure_mgmt_operational_insights/models/linked_service.rb +83 -0
  16. data/lib/generated/azure_mgmt_operational_insights/models/linked_service_list_result.rb +53 -0
  17. data/lib/generated/azure_mgmt_operational_insights/models/management_group.rb +119 -0
  18. data/lib/generated/azure_mgmt_operational_insights/models/metric_name.rb +54 -0
  19. data/lib/generated/azure_mgmt_operational_insights/models/proxy_resource.rb +84 -0
  20. data/lib/generated/azure_mgmt_operational_insights/models/resource.rb +94 -0
  21. data/lib/generated/azure_mgmt_operational_insights/models/saved_search.rb +121 -0
  22. data/lib/generated/azure_mgmt_operational_insights/models/saved_searches_list_result.rb +63 -0
  23. data/lib/generated/azure_mgmt_operational_insights/models/search_error.rb +54 -0
  24. data/lib/generated/azure_mgmt_operational_insights/models/search_get_schema_response.rb +63 -0
  25. data/lib/generated/azure_mgmt_operational_insights/models/search_highlight.rb +54 -0
  26. data/lib/generated/azure_mgmt_operational_insights/models/search_metadata.rb +221 -0
  27. data/lib/generated/azure_mgmt_operational_insights/models/search_metadata_schema.rb +54 -0
  28. data/lib/generated/azure_mgmt_operational_insights/models/search_parameters.rb +88 -0
  29. data/lib/generated/azure_mgmt_operational_insights/models/search_results_response.rb +84 -0
  30. data/lib/generated/azure_mgmt_operational_insights/models/search_schema_value.rb +114 -0
  31. data/lib/generated/azure_mgmt_operational_insights/models/search_sort.rb +55 -0
  32. data/lib/generated/azure_mgmt_operational_insights/models/search_sort_enum.rb +16 -0
  33. data/lib/generated/azure_mgmt_operational_insights/models/shared_keys.rb +54 -0
  34. data/lib/generated/azure_mgmt_operational_insights/models/sku.rb +45 -0
  35. data/lib/generated/azure_mgmt_operational_insights/models/sku_name_enum.rb +20 -0
  36. data/lib/generated/azure_mgmt_operational_insights/models/storage_account.rb +55 -0
  37. data/lib/generated/azure_mgmt_operational_insights/models/storage_insight.rb +141 -0
  38. data/lib/generated/azure_mgmt_operational_insights/models/storage_insight_list_result.rb +95 -0
  39. data/lib/generated/azure_mgmt_operational_insights/models/storage_insight_state.rb +16 -0
  40. data/lib/generated/azure_mgmt_operational_insights/models/storage_insight_status.rb +55 -0
  41. data/lib/generated/azure_mgmt_operational_insights/models/tag.rb +54 -0
  42. data/lib/generated/azure_mgmt_operational_insights/models/usage_metric.rb +96 -0
  43. data/lib/generated/azure_mgmt_operational_insights/models/workspace.rb +165 -0
  44. data/lib/generated/azure_mgmt_operational_insights/models/workspace_list_management_groups_result.rb +53 -0
  45. data/lib/generated/azure_mgmt_operational_insights/models/workspace_list_result.rb +52 -0
  46. data/lib/generated/azure_mgmt_operational_insights/models/workspace_list_usages_result.rb +53 -0
  47. data/lib/generated/azure_mgmt_operational_insights/module_definition.rb +8 -0
  48. data/lib/generated/azure_mgmt_operational_insights/operational_insights_management_client.rb +143 -0
  49. data/lib/generated/azure_mgmt_operational_insights/saved_searches.rb +513 -0
  50. data/lib/generated/azure_mgmt_operational_insights/storage_insights.rb +560 -0
  51. data/lib/generated/azure_mgmt_operational_insights/version.rb +8 -0
  52. data/lib/generated/azure_mgmt_operational_insights/workspaces.rb +1569 -0
  53. metadata +164 -0
@@ -0,0 +1,560 @@
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::ARM::OperationalInsights
7
+ #
8
+ # Operational Insights Client
9
+ #
10
+ class StorageInsights
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the StorageInsights class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [OperationalInsightsManagementClient] reference to the OperationalInsightsManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Create or update a storage insight.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group to get.
28
+ # The name is case insensitive.
29
+ # @param workspace_name [String] Log Analytics Workspace name that will contain
30
+ # the storageInsightsConfigs resource
31
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
32
+ # resource
33
+ # @param parameters [StorageInsight] The parameters required to create or
34
+ # update a storage insight.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [StorageInsight] operation results.
39
+ #
40
+ def create_or_update(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers = nil)
41
+ response = create_or_update_async(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Create or update a storage insight.
47
+ #
48
+ # @param resource_group_name [String] The name of the resource group to get.
49
+ # The name is case insensitive.
50
+ # @param workspace_name [String] Log Analytics Workspace name that will contain
51
+ # the storageInsightsConfigs resource
52
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
53
+ # resource
54
+ # @param parameters [StorageInsight] The parameters required to create or
55
+ # update a storage insight.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def create_or_update_with_http_info(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers = nil)
62
+ create_or_update_async(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Create or update a storage insight.
67
+ #
68
+ # @param resource_group_name [String] The name of the resource group to get.
69
+ # The name is case insensitive.
70
+ # @param workspace_name [String] Log Analytics Workspace name that will contain
71
+ # the storageInsightsConfigs resource
72
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
73
+ # resource
74
+ # @param parameters [StorageInsight] The parameters required to create or
75
+ # update a storage insight.
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def create_or_update_async(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers = nil)
82
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
83
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
84
+ fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
85
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
86
+ api_version = '2015-03-20'
87
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
88
+
89
+
90
+ request_headers = {}
91
+
92
+ # Set Headers
93
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
94
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
95
+
96
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
97
+
98
+ # Serialize Request
99
+ request_mapper = Azure::ARM::OperationalInsights::Models::StorageInsight.mapper()
100
+ request_content = @client.serialize(request_mapper, parameters)
101
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
102
+
103
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'
104
+
105
+ request_url = @base_url || @client.base_url
106
+
107
+ options = {
108
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
109
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'storageInsightName' => storage_insight_name,'subscriptionId' => @client.subscription_id},
110
+ query_params: {'api-version' => api_version},
111
+ body: request_content,
112
+ headers: request_headers.merge(custom_headers || {}),
113
+ base_url: request_url
114
+ }
115
+ promise = @client.make_request_async(:put, path_template, options)
116
+
117
+ promise = promise.then do |result|
118
+ http_response = result.response
119
+ status_code = http_response.status
120
+ response_content = http_response.body
121
+ unless status_code == 201 || status_code == 200
122
+ error_model = JSON.load(response_content)
123
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
124
+ end
125
+
126
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
127
+ # Deserialize Response
128
+ if status_code == 201
129
+ begin
130
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
+ result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsight.mapper()
132
+ result.body = @client.deserialize(result_mapper, parsed_response)
133
+ rescue Exception => e
134
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
135
+ end
136
+ end
137
+ # Deserialize Response
138
+ if status_code == 200
139
+ begin
140
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
141
+ result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsight.mapper()
142
+ result.body = @client.deserialize(result_mapper, parsed_response)
143
+ rescue Exception => e
144
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
145
+ end
146
+ end
147
+
148
+ result
149
+ end
150
+
151
+ promise.execute
152
+ end
153
+
154
+ #
155
+ # Gets a storage insight instance.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group to get.
158
+ # The name is case insensitive.
159
+ # @param workspace_name [String] Log Analytics Workspace name that contains the
160
+ # storageInsightsConfigs resource
161
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
162
+ # resource
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [StorageInsight] operation results.
167
+ #
168
+ def get(resource_group_name, workspace_name, storage_insight_name, custom_headers = nil)
169
+ response = get_async(resource_group_name, workspace_name, storage_insight_name, custom_headers).value!
170
+ response.body unless response.nil?
171
+ end
172
+
173
+ #
174
+ # Gets a storage insight instance.
175
+ #
176
+ # @param resource_group_name [String] The name of the resource group to get.
177
+ # The name is case insensitive.
178
+ # @param workspace_name [String] Log Analytics Workspace name that contains the
179
+ # storageInsightsConfigs resource
180
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
181
+ # resource
182
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
183
+ # will be added to the HTTP request.
184
+ #
185
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
186
+ #
187
+ def get_with_http_info(resource_group_name, workspace_name, storage_insight_name, custom_headers = nil)
188
+ get_async(resource_group_name, workspace_name, storage_insight_name, custom_headers).value!
189
+ end
190
+
191
+ #
192
+ # Gets a storage insight instance.
193
+ #
194
+ # @param resource_group_name [String] The name of the resource group to get.
195
+ # The name is case insensitive.
196
+ # @param workspace_name [String] Log Analytics Workspace name that contains the
197
+ # storageInsightsConfigs resource
198
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
199
+ # resource
200
+ # @param [Hash{String => String}] A hash of custom headers that will be added
201
+ # to the HTTP request.
202
+ #
203
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
204
+ #
205
+ def get_async(resource_group_name, workspace_name, storage_insight_name, custom_headers = nil)
206
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
207
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
208
+ fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
209
+ api_version = '2015-03-20'
210
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
211
+
212
+
213
+ request_headers = {}
214
+
215
+ # Set Headers
216
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
217
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
218
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'
219
+
220
+ request_url = @base_url || @client.base_url
221
+
222
+ options = {
223
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
224
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'storageInsightName' => storage_insight_name,'subscriptionId' => @client.subscription_id},
225
+ query_params: {'api-version' => api_version},
226
+ headers: request_headers.merge(custom_headers || {}),
227
+ base_url: request_url
228
+ }
229
+ promise = @client.make_request_async(:get, path_template, options)
230
+
231
+ promise = promise.then do |result|
232
+ http_response = result.response
233
+ status_code = http_response.status
234
+ response_content = http_response.body
235
+ unless status_code == 200
236
+ error_model = JSON.load(response_content)
237
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
238
+ end
239
+
240
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
241
+ # Deserialize Response
242
+ if status_code == 200
243
+ begin
244
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
245
+ result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsight.mapper()
246
+ result.body = @client.deserialize(result_mapper, parsed_response)
247
+ rescue Exception => e
248
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
249
+ end
250
+ end
251
+
252
+ result
253
+ end
254
+
255
+ promise.execute
256
+ end
257
+
258
+ #
259
+ # Deletes a storageInsightsConfigs resource
260
+ #
261
+ # @param resource_group_name [String] The name of the resource group to get.
262
+ # The name is case insensitive.
263
+ # @param workspace_name [String] Log Analytics Workspace name that contains the
264
+ # storageInsightsConfigs resource
265
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
266
+ # resource
267
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
268
+ # will be added to the HTTP request.
269
+ #
270
+ #
271
+ def delete(resource_group_name, workspace_name, storage_insight_name, custom_headers = nil)
272
+ response = delete_async(resource_group_name, workspace_name, storage_insight_name, custom_headers).value!
273
+ nil
274
+ end
275
+
276
+ #
277
+ # Deletes a storageInsightsConfigs resource
278
+ #
279
+ # @param resource_group_name [String] The name of the resource group to get.
280
+ # The name is case insensitive.
281
+ # @param workspace_name [String] Log Analytics Workspace name that contains the
282
+ # storageInsightsConfigs resource
283
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
284
+ # resource
285
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
286
+ # will be added to the HTTP request.
287
+ #
288
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
289
+ #
290
+ def delete_with_http_info(resource_group_name, workspace_name, storage_insight_name, custom_headers = nil)
291
+ delete_async(resource_group_name, workspace_name, storage_insight_name, custom_headers).value!
292
+ end
293
+
294
+ #
295
+ # Deletes a storageInsightsConfigs resource
296
+ #
297
+ # @param resource_group_name [String] The name of the resource group to get.
298
+ # The name is case insensitive.
299
+ # @param workspace_name [String] Log Analytics Workspace name that contains the
300
+ # storageInsightsConfigs resource
301
+ # @param storage_insight_name [String] Name of the storageInsightsConfigs
302
+ # resource
303
+ # @param [Hash{String => String}] A hash of custom headers that will be added
304
+ # to the HTTP request.
305
+ #
306
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
307
+ #
308
+ def delete_async(resource_group_name, workspace_name, storage_insight_name, custom_headers = nil)
309
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
310
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
311
+ fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
312
+ api_version = '2015-03-20'
313
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
314
+
315
+
316
+ request_headers = {}
317
+
318
+ # Set Headers
319
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
320
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
321
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'
322
+
323
+ request_url = @base_url || @client.base_url
324
+
325
+ options = {
326
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
327
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'storageInsightName' => storage_insight_name,'subscriptionId' => @client.subscription_id},
328
+ query_params: {'api-version' => api_version},
329
+ headers: request_headers.merge(custom_headers || {}),
330
+ base_url: request_url
331
+ }
332
+ promise = @client.make_request_async(:delete, path_template, options)
333
+
334
+ promise = promise.then do |result|
335
+ http_response = result.response
336
+ status_code = http_response.status
337
+ response_content = http_response.body
338
+ unless status_code == 200 || status_code == 204
339
+ error_model = JSON.load(response_content)
340
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
341
+ end
342
+
343
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
344
+
345
+ result
346
+ end
347
+
348
+ promise.execute
349
+ end
350
+
351
+ #
352
+ # Lists the storage insight instances within a workspace
353
+ #
354
+ # @param resource_group_name [String] The name of the resource group to get.
355
+ # The name is case insensitive.
356
+ # @param workspace_name [String] Log Analytics Workspace name that will contain
357
+ # the storageInsightsConfigs resource
358
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
359
+ # will be added to the HTTP request.
360
+ #
361
+ # @return [Array<StorageInsight>] operation results.
362
+ #
363
+ def list_by_workspace(resource_group_name, workspace_name, custom_headers = nil)
364
+ first_page = list_by_workspace_as_lazy(resource_group_name, workspace_name, custom_headers)
365
+ first_page.get_all_items
366
+ end
367
+
368
+ #
369
+ # Lists the storage insight instances within a workspace
370
+ #
371
+ # @param resource_group_name [String] The name of the resource group to get.
372
+ # The name is case insensitive.
373
+ # @param workspace_name [String] Log Analytics Workspace name that will contain
374
+ # the storageInsightsConfigs resource
375
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
376
+ # will be added to the HTTP request.
377
+ #
378
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
379
+ #
380
+ def list_by_workspace_with_http_info(resource_group_name, workspace_name, custom_headers = nil)
381
+ list_by_workspace_async(resource_group_name, workspace_name, custom_headers).value!
382
+ end
383
+
384
+ #
385
+ # Lists the storage insight instances within a workspace
386
+ #
387
+ # @param resource_group_name [String] The name of the resource group to get.
388
+ # The name is case insensitive.
389
+ # @param workspace_name [String] Log Analytics Workspace name that will contain
390
+ # the storageInsightsConfigs resource
391
+ # @param [Hash{String => String}] A hash of custom headers that will be added
392
+ # to the HTTP request.
393
+ #
394
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
395
+ #
396
+ def list_by_workspace_async(resource_group_name, workspace_name, custom_headers = nil)
397
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
398
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
399
+ api_version = '2015-03-20'
400
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
401
+
402
+
403
+ request_headers = {}
404
+
405
+ # Set Headers
406
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
407
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
408
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs'
409
+
410
+ request_url = @base_url || @client.base_url
411
+
412
+ options = {
413
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
414
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id},
415
+ query_params: {'api-version' => api_version},
416
+ headers: request_headers.merge(custom_headers || {}),
417
+ base_url: request_url
418
+ }
419
+ promise = @client.make_request_async(:get, path_template, options)
420
+
421
+ promise = promise.then do |result|
422
+ http_response = result.response
423
+ status_code = http_response.status
424
+ response_content = http_response.body
425
+ unless status_code == 200
426
+ error_model = JSON.load(response_content)
427
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
428
+ end
429
+
430
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
431
+ # Deserialize Response
432
+ if status_code == 200
433
+ begin
434
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
435
+ result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsightListResult.mapper()
436
+ result.body = @client.deserialize(result_mapper, parsed_response)
437
+ rescue Exception => e
438
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
439
+ end
440
+ end
441
+
442
+ result
443
+ end
444
+
445
+ promise.execute
446
+ end
447
+
448
+ #
449
+ # Lists the storage insight instances within a workspace
450
+ #
451
+ # @param next_page_link [String] The NextLink from the previous successful call
452
+ # to List operation.
453
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
454
+ # will be added to the HTTP request.
455
+ #
456
+ # @return [StorageInsightListResult] operation results.
457
+ #
458
+ def list_by_workspace_next(next_page_link, custom_headers = nil)
459
+ response = list_by_workspace_next_async(next_page_link, custom_headers).value!
460
+ response.body unless response.nil?
461
+ end
462
+
463
+ #
464
+ # Lists the storage insight instances within a workspace
465
+ #
466
+ # @param next_page_link [String] The NextLink from the previous successful call
467
+ # to List operation.
468
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
469
+ # will be added to the HTTP request.
470
+ #
471
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
472
+ #
473
+ def list_by_workspace_next_with_http_info(next_page_link, custom_headers = nil)
474
+ list_by_workspace_next_async(next_page_link, custom_headers).value!
475
+ end
476
+
477
+ #
478
+ # Lists the storage insight instances within a workspace
479
+ #
480
+ # @param next_page_link [String] The NextLink from the previous successful call
481
+ # to List operation.
482
+ # @param [Hash{String => String}] A hash of custom headers that will be added
483
+ # to the HTTP request.
484
+ #
485
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
486
+ #
487
+ def list_by_workspace_next_async(next_page_link, custom_headers = nil)
488
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
489
+
490
+
491
+ request_headers = {}
492
+
493
+ # Set Headers
494
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
495
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
496
+ path_template = '{nextLink}'
497
+
498
+ request_url = @base_url || @client.base_url
499
+
500
+ options = {
501
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
502
+ skip_encoding_path_params: {'nextLink' => next_page_link},
503
+ headers: request_headers.merge(custom_headers || {}),
504
+ base_url: request_url
505
+ }
506
+ promise = @client.make_request_async(:get, path_template, options)
507
+
508
+ promise = promise.then do |result|
509
+ http_response = result.response
510
+ status_code = http_response.status
511
+ response_content = http_response.body
512
+ unless status_code == 200
513
+ error_model = JSON.load(response_content)
514
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
515
+ end
516
+
517
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
518
+ # Deserialize Response
519
+ if status_code == 200
520
+ begin
521
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
522
+ result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsightListResult.mapper()
523
+ result.body = @client.deserialize(result_mapper, parsed_response)
524
+ rescue Exception => e
525
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
526
+ end
527
+ end
528
+
529
+ result
530
+ end
531
+
532
+ promise.execute
533
+ end
534
+
535
+ #
536
+ # Lists the storage insight instances within a workspace
537
+ #
538
+ # @param resource_group_name [String] The name of the resource group to get.
539
+ # The name is case insensitive.
540
+ # @param workspace_name [String] Log Analytics Workspace name that will contain
541
+ # the storageInsightsConfigs resource
542
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
543
+ # will be added to the HTTP request.
544
+ #
545
+ # @return [StorageInsightListResult] which provide lazy access to pages of the
546
+ # response.
547
+ #
548
+ def list_by_workspace_as_lazy(resource_group_name, workspace_name, custom_headers = nil)
549
+ response = list_by_workspace_async(resource_group_name, workspace_name, custom_headers).value!
550
+ unless response.nil?
551
+ page = response.body
552
+ page.next_method = Proc.new do |next_page_link|
553
+ list_by_workspace_next_async(next_page_link, custom_headers)
554
+ end
555
+ page
556
+ end
557
+ end
558
+
559
+ end
560
+ end