azure_mgmt_operational_insights 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-03-20/generated/azure_mgmt_operational_insights.rb +52 -0
  3. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/core_summary.rb +1 -1
  4. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/link_target.rb +1 -1
  5. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/proxy_resource.rb +1 -1
  6. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/resource.rb +1 -1
  7. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/saved_search.rb +1 -1
  8. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/saved_searches_list_result.rb +1 -1
  9. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_error.rb +1 -1
  10. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_get_schema_response.rb +1 -1
  11. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_highlight.rb +1 -1
  12. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_metadata.rb +1 -1
  13. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_metadata_schema.rb +1 -1
  14. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_parameters.rb +1 -1
  15. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_results_response.rb +1 -1
  16. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_schema_value.rb +1 -1
  17. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_sort.rb +1 -1
  18. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/search_sort_enum.rb +1 -1
  19. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/storage_account.rb +1 -1
  20. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/storage_insight.rb +1 -1
  21. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/storage_insight_list_result.rb +1 -1
  22. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/storage_insight_state.rb +1 -1
  23. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/storage_insight_status.rb +1 -1
  24. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/models/tag.rb +1 -1
  25. data/lib/2015-03-20/generated/azure_mgmt_operational_insights/module_definition.rb +9 -0
  26. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/operational_insights_management_client.rb +10 -14
  27. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/saved_searches.rb +16 -16
  28. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/storage_insights.rb +15 -15
  29. data/lib/{generated → 2015-03-20/generated}/azure_mgmt_operational_insights/version.rb +2 -2
  30. data/lib/2015-03-20/generated/azure_mgmt_operational_insights/workspaces.rb +489 -0
  31. data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights.rb +50 -0
  32. data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/azure_log_analytics.rb +139 -0
  33. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/data_sources.rb +17 -17
  34. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/linked_services.rb +16 -16
  35. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/data_source.rb +1 -1
  36. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/data_source_filter.rb +1 -1
  37. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/data_source_kind.rb +1 -1
  38. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/data_source_list_result.rb +1 -1
  39. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/entity_status.rb +1 -1
  40. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/intelligence_pack.rb +1 -1
  41. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/linked_service.rb +1 -1
  42. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/linked_service_list_result.rb +1 -1
  43. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/management_group.rb +1 -1
  44. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/metric_name.rb +1 -1
  45. data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/proxy_resource.rb +84 -0
  46. data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/resource.rb +94 -0
  47. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/shared_keys.rb +1 -1
  48. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/sku.rb +1 -1
  49. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/sku_name_enum.rb +1 -1
  50. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/usage_metric.rb +1 -1
  51. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/workspace.rb +1 -1
  52. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/workspace_list_management_groups_result.rb +1 -1
  53. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/workspace_list_result.rb +1 -1
  54. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/models/workspace_list_usages_result.rb +1 -1
  55. data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/module_definition.rb +9 -0
  56. data/lib/{generated/azure_mgmt_operational_insights/module_definition.rb → 2015-11-01-preview/generated/azure_mgmt_operational_insights/version.rb} +3 -3
  57. data/lib/{generated → 2015-11-01-preview/generated}/azure_mgmt_operational_insights/workspaces.rb +35 -499
  58. data/lib/azure_mgmt_operational_insights.rb +3 -4
  59. data/lib/module_definition.rb +7 -0
  60. data/lib/profiles/common/configurable.rb +73 -0
  61. data/lib/profiles/common/default.rb +68 -0
  62. data/lib/profiles/latest/modules/operationalinsights_profile_module.rb +215 -0
  63. data/lib/profiles/latest/operationalinsights_latest_profile_client.rb +33 -0
  64. data/lib/profiles/latest/operationalinsights_module_definition.rb +9 -0
  65. data/lib/version.rb +7 -0
  66. metadata +65 -51
  67. data/lib/generated/azure_mgmt_operational_insights.rb +0 -72
@@ -3,7 +3,7 @@
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
- module Azure::ARM::OperationalInsights
6
+ module Azure::OperationalInsights::Mgmt::V2015_03_20
7
7
  #
8
8
  # Operational Insights Client
9
9
  #
@@ -83,7 +83,7 @@ module Azure::ARM::OperationalInsights
83
83
  fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
84
84
  fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
85
85
  fail ArgumentError, 'parameters is nil' if parameters.nil?
86
- api_version = '2015-03-20'
86
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
87
87
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
88
88
 
89
89
 
@@ -96,7 +96,7 @@ module Azure::ARM::OperationalInsights
96
96
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
97
97
 
98
98
  # Serialize Request
99
- request_mapper = Azure::ARM::OperationalInsights::Models::StorageInsight.mapper()
99
+ request_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::StorageInsight.mapper()
100
100
  request_content = @client.serialize(request_mapper, parameters)
101
101
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
102
102
 
@@ -107,7 +107,7 @@ module Azure::ARM::OperationalInsights
107
107
  options = {
108
108
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
109
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},
110
+ query_params: {'api-version' => @client.api_version},
111
111
  body: request_content,
112
112
  headers: request_headers.merge(custom_headers || {}),
113
113
  base_url: request_url
@@ -128,7 +128,7 @@ module Azure::ARM::OperationalInsights
128
128
  if status_code == 201
129
129
  begin
130
130
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
- result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsight.mapper()
131
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::StorageInsight.mapper()
132
132
  result.body = @client.deserialize(result_mapper, parsed_response)
133
133
  rescue Exception => e
134
134
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -138,7 +138,7 @@ module Azure::ARM::OperationalInsights
138
138
  if status_code == 200
139
139
  begin
140
140
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
141
- result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsight.mapper()
141
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::StorageInsight.mapper()
142
142
  result.body = @client.deserialize(result_mapper, parsed_response)
143
143
  rescue Exception => e
144
144
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -206,7 +206,7 @@ module Azure::ARM::OperationalInsights
206
206
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
207
207
  fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
208
208
  fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
209
- api_version = '2015-03-20'
209
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
210
210
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
211
211
 
212
212
 
@@ -222,7 +222,7 @@ module Azure::ARM::OperationalInsights
222
222
  options = {
223
223
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
224
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},
225
+ query_params: {'api-version' => @client.api_version},
226
226
  headers: request_headers.merge(custom_headers || {}),
227
227
  base_url: request_url
228
228
  }
@@ -242,7 +242,7 @@ module Azure::ARM::OperationalInsights
242
242
  if status_code == 200
243
243
  begin
244
244
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
245
- result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsight.mapper()
245
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::StorageInsight.mapper()
246
246
  result.body = @client.deserialize(result_mapper, parsed_response)
247
247
  rescue Exception => e
248
248
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -309,7 +309,7 @@ module Azure::ARM::OperationalInsights
309
309
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
310
310
  fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
311
311
  fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
312
- api_version = '2015-03-20'
312
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
313
313
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
314
314
 
315
315
 
@@ -325,7 +325,7 @@ module Azure::ARM::OperationalInsights
325
325
  options = {
326
326
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
327
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},
328
+ query_params: {'api-version' => @client.api_version},
329
329
  headers: request_headers.merge(custom_headers || {}),
330
330
  base_url: request_url
331
331
  }
@@ -396,7 +396,7 @@ module Azure::ARM::OperationalInsights
396
396
  def list_by_workspace_async(resource_group_name, workspace_name, custom_headers = nil)
397
397
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
398
398
  fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
399
- api_version = '2015-03-20'
399
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
400
400
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
401
401
 
402
402
 
@@ -412,7 +412,7 @@ module Azure::ARM::OperationalInsights
412
412
  options = {
413
413
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
414
414
  path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id},
415
- query_params: {'api-version' => api_version},
415
+ query_params: {'api-version' => @client.api_version},
416
416
  headers: request_headers.merge(custom_headers || {}),
417
417
  base_url: request_url
418
418
  }
@@ -432,7 +432,7 @@ module Azure::ARM::OperationalInsights
432
432
  if status_code == 200
433
433
  begin
434
434
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
435
- result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsightListResult.mapper()
435
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::StorageInsightListResult.mapper()
436
436
  result.body = @client.deserialize(result_mapper, parsed_response)
437
437
  rescue Exception => e
438
438
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -519,7 +519,7 @@ module Azure::ARM::OperationalInsights
519
519
  if status_code == 200
520
520
  begin
521
521
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
522
- result_mapper = Azure::ARM::OperationalInsights::Models::StorageInsightListResult.mapper()
522
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::StorageInsightListResult.mapper()
523
523
  result.body = @client.deserialize(result_mapper, parsed_response)
524
524
  rescue Exception => e
525
525
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -3,6 +3,6 @@
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
- module Azure::ARM::OperationalInsights
7
- VERSION = '0.14.0'
6
+ module Azure::OperationalInsights::Mgmt::V2015_03_20
7
+ VERSION = '0.15.0'
8
8
  end
@@ -0,0 +1,489 @@
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::OperationalInsights::Mgmt::V2015_03_20
7
+ #
8
+ # Operational Insights Client
9
+ #
10
+ class Workspaces
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Workspaces 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
+ # Get a list of workspaces which the current user has administrator privileges
26
+ # and are not associated with an Azure Subscription. The subscriptionId
27
+ # parameter in the Url is ignored.
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array] operation results.
33
+ #
34
+ def list_link_targets(custom_headers = nil)
35
+ response = list_link_targets_async(custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Get a list of workspaces which the current user has administrator privileges
41
+ # and are not associated with an Azure Subscription. The subscriptionId
42
+ # parameter in the Url is ignored.
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_link_targets_with_http_info(custom_headers = nil)
50
+ list_link_targets_async(custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Get a list of workspaces which the current user has administrator privileges
55
+ # and are not associated with an Azure Subscription. The subscriptionId
56
+ # parameter in the Url is ignored.
57
+ #
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_link_targets_async(custom_headers = nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+
67
+
68
+ request_headers = {}
69
+
70
+ # Set Headers
71
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/linkTargets'
74
+
75
+ request_url = @base_url || @client.base_url
76
+
77
+ options = {
78
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
79
+ path_params: {'subscriptionId' => @client.subscription_id},
80
+ query_params: {'api-version' => @client.api_version},
81
+ headers: request_headers.merge(custom_headers || {}),
82
+ base_url: request_url
83
+ }
84
+ promise = @client.make_request_async(:get, path_template, options)
85
+
86
+ promise = promise.then do |result|
87
+ http_response = result.response
88
+ status_code = http_response.status
89
+ response_content = http_response.body
90
+ unless status_code == 200
91
+ error_model = JSON.load(response_content)
92
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
93
+ end
94
+
95
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
96
+ # Deserialize Response
97
+ if status_code == 200
98
+ begin
99
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
100
+ result_mapper = {
101
+ required: false,
102
+ serialized_name: 'parsed_response',
103
+ type: {
104
+ name: 'Sequence',
105
+ element: {
106
+ required: false,
107
+ serialized_name: 'LinkTargetElementType',
108
+ type: {
109
+ name: 'Composite',
110
+ class_name: 'LinkTarget'
111
+ }
112
+ }
113
+ }
114
+ }
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Gets the schema for a given workspace.
129
+ #
130
+ # @param resource_group_name [String] The name of the resource group to get.
131
+ # The name is case insensitive.
132
+ # @param workspace_name [String] Log Analytics workspace name
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [SearchGetSchemaResponse] operation results.
137
+ #
138
+ def get_schema(resource_group_name, workspace_name, custom_headers = nil)
139
+ response = get_schema_async(resource_group_name, workspace_name, custom_headers).value!
140
+ response.body unless response.nil?
141
+ end
142
+
143
+ #
144
+ # Gets the schema for a given workspace.
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group to get.
147
+ # The name is case insensitive.
148
+ # @param workspace_name [String] Log Analytics workspace name
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
153
+ #
154
+ def get_schema_with_http_info(resource_group_name, workspace_name, custom_headers = nil)
155
+ get_schema_async(resource_group_name, workspace_name, custom_headers).value!
156
+ end
157
+
158
+ #
159
+ # Gets the schema for a given workspace.
160
+ #
161
+ # @param resource_group_name [String] The name of the resource group to get.
162
+ # The name is case insensitive.
163
+ # @param workspace_name [String] Log Analytics workspace name
164
+ # @param [Hash{String => String}] A hash of custom headers that will be added
165
+ # to the HTTP request.
166
+ #
167
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
168
+ #
169
+ def get_schema_async(resource_group_name, workspace_name, custom_headers = nil)
170
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
171
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
172
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
173
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
174
+
175
+
176
+ request_headers = {}
177
+
178
+ # Set Headers
179
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
180
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
181
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema'
182
+
183
+ request_url = @base_url || @client.base_url
184
+
185
+ options = {
186
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
187
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id},
188
+ query_params: {'api-version' => @client.api_version},
189
+ headers: request_headers.merge(custom_headers || {}),
190
+ base_url: request_url
191
+ }
192
+ promise = @client.make_request_async(:post, path_template, options)
193
+
194
+ promise = promise.then do |result|
195
+ http_response = result.response
196
+ status_code = http_response.status
197
+ response_content = http_response.body
198
+ unless status_code == 200
199
+ error_model = JSON.load(response_content)
200
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
201
+ end
202
+
203
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
204
+ # Deserialize Response
205
+ if status_code == 200
206
+ begin
207
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
208
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::SearchGetSchemaResponse.mapper()
209
+ result.body = @client.deserialize(result_mapper, parsed_response)
210
+ rescue Exception => e
211
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
212
+ end
213
+ end
214
+
215
+ result
216
+ end
217
+
218
+ promise.execute
219
+ end
220
+
221
+ #
222
+ # Submit a search for a given workspace. The response will contain an id to
223
+ # track the search. User can use the id to poll the search status and get the
224
+ # full search result later if the search takes long time to finish.
225
+ #
226
+ # @param resource_group_name [String] The name of the resource group to get.
227
+ # The name is case insensitive.
228
+ # @param workspace_name [String] Log Analytics workspace name
229
+ # @param parameters [SearchParameters] The parameters required to execute a
230
+ # search query.
231
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
232
+ # will be added to the HTTP request.
233
+ #
234
+ # @return [SearchResultsResponse] operation results.
235
+ #
236
+ def get_search_results(resource_group_name, workspace_name, parameters, custom_headers = nil)
237
+ response = get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers).value!
238
+ response.body unless response.nil?
239
+ end
240
+
241
+ #
242
+ # @param resource_group_name [String] The name of the resource group to get.
243
+ # The name is case insensitive.
244
+ # @param workspace_name [String] Log Analytics workspace name
245
+ # @param parameters [SearchParameters] The parameters required to execute a
246
+ # search query.
247
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
248
+ # will be added to the HTTP request.
249
+ #
250
+ # @return [Concurrent::Promise] promise which provides async access to http
251
+ # response.
252
+ #
253
+ def get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers = nil)
254
+ # Send request
255
+ promise = begin_get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers)
256
+
257
+ promise = promise.then do |response|
258
+ # Defining deserialization method.
259
+ deserialize_method = lambda do |parsed_response|
260
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::SearchResultsResponse.mapper()
261
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
262
+ end
263
+
264
+ # Waiting for response.
265
+ @client.get_long_running_operation_result(response, deserialize_method)
266
+ end
267
+
268
+ promise
269
+ end
270
+
271
+ #
272
+ # Gets updated search results for a given search query.
273
+ #
274
+ # @param resource_group_name [String] The name of the resource group to get.
275
+ # The name is case insensitive.
276
+ # @param workspace_name [String] Log Analytics workspace name
277
+ # @param id [String] The id of the search that will have results updated. You
278
+ # can get the id from the response of the GetResults call.
279
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
280
+ # will be added to the HTTP request.
281
+ #
282
+ # @return [SearchResultsResponse] operation results.
283
+ #
284
+ def update_search_results(resource_group_name, workspace_name, id, custom_headers = nil)
285
+ response = update_search_results_async(resource_group_name, workspace_name, id, custom_headers).value!
286
+ response.body unless response.nil?
287
+ end
288
+
289
+ #
290
+ # Gets updated search results for a given search query.
291
+ #
292
+ # @param resource_group_name [String] The name of the resource group to get.
293
+ # The name is case insensitive.
294
+ # @param workspace_name [String] Log Analytics workspace name
295
+ # @param id [String] The id of the search that will have results updated. You
296
+ # can get the id from the response of the GetResults call.
297
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
298
+ # will be added to the HTTP request.
299
+ #
300
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
301
+ #
302
+ def update_search_results_with_http_info(resource_group_name, workspace_name, id, custom_headers = nil)
303
+ update_search_results_async(resource_group_name, workspace_name, id, custom_headers).value!
304
+ end
305
+
306
+ #
307
+ # Gets updated search results for a given search query.
308
+ #
309
+ # @param resource_group_name [String] The name of the resource group to get.
310
+ # The name is case insensitive.
311
+ # @param workspace_name [String] Log Analytics workspace name
312
+ # @param id [String] The id of the search that will have results updated. You
313
+ # can get the id from the response of the GetResults call.
314
+ # @param [Hash{String => String}] A hash of custom headers that will be added
315
+ # to the HTTP request.
316
+ #
317
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
318
+ #
319
+ def update_search_results_async(resource_group_name, workspace_name, id, custom_headers = nil)
320
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
321
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
322
+ fail ArgumentError, 'id is nil' if id.nil?
323
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
324
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
325
+
326
+
327
+ request_headers = {}
328
+
329
+ # Set Headers
330
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
331
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
332
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search/{id}'
333
+
334
+ request_url = @base_url || @client.base_url
335
+
336
+ options = {
337
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
338
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'id' => id,'subscriptionId' => @client.subscription_id},
339
+ query_params: {'api-version' => @client.api_version},
340
+ headers: request_headers.merge(custom_headers || {}),
341
+ base_url: request_url
342
+ }
343
+ promise = @client.make_request_async(:post, path_template, options)
344
+
345
+ promise = promise.then do |result|
346
+ http_response = result.response
347
+ status_code = http_response.status
348
+ response_content = http_response.body
349
+ unless status_code == 200
350
+ error_model = JSON.load(response_content)
351
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
352
+ end
353
+
354
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
355
+ # Deserialize Response
356
+ if status_code == 200
357
+ begin
358
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
359
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::SearchResultsResponse.mapper()
360
+ result.body = @client.deserialize(result_mapper, parsed_response)
361
+ rescue Exception => e
362
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
363
+ end
364
+ end
365
+
366
+ result
367
+ end
368
+
369
+ promise.execute
370
+ end
371
+
372
+ #
373
+ # Submit a search for a given workspace. The response will contain an id to
374
+ # track the search. User can use the id to poll the search status and get the
375
+ # full search result later if the search takes long time to finish.
376
+ #
377
+ # @param resource_group_name [String] The name of the resource group to get.
378
+ # The name is case insensitive.
379
+ # @param workspace_name [String] Log Analytics workspace name
380
+ # @param parameters [SearchParameters] The parameters required to execute a
381
+ # search query.
382
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
383
+ # will be added to the HTTP request.
384
+ #
385
+ # @return [SearchResultsResponse] operation results.
386
+ #
387
+ def begin_get_search_results(resource_group_name, workspace_name, parameters, custom_headers = nil)
388
+ response = begin_get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers).value!
389
+ response.body unless response.nil?
390
+ end
391
+
392
+ #
393
+ # Submit a search for a given workspace. The response will contain an id to
394
+ # track the search. User can use the id to poll the search status and get the
395
+ # full search result later if the search takes long time to finish.
396
+ #
397
+ # @param resource_group_name [String] The name of the resource group to get.
398
+ # The name is case insensitive.
399
+ # @param workspace_name [String] Log Analytics workspace name
400
+ # @param parameters [SearchParameters] The parameters required to execute a
401
+ # search query.
402
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
403
+ # will be added to the HTTP request.
404
+ #
405
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
406
+ #
407
+ def begin_get_search_results_with_http_info(resource_group_name, workspace_name, parameters, custom_headers = nil)
408
+ begin_get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers).value!
409
+ end
410
+
411
+ #
412
+ # Submit a search for a given workspace. The response will contain an id to
413
+ # track the search. User can use the id to poll the search status and get the
414
+ # full search result later if the search takes long time to finish.
415
+ #
416
+ # @param resource_group_name [String] The name of the resource group to get.
417
+ # The name is case insensitive.
418
+ # @param workspace_name [String] Log Analytics workspace name
419
+ # @param parameters [SearchParameters] The parameters required to execute a
420
+ # search query.
421
+ # @param [Hash{String => String}] A hash of custom headers that will be added
422
+ # to the HTTP request.
423
+ #
424
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
425
+ #
426
+ def begin_get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers = nil)
427
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
428
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
429
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
430
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
431
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
432
+
433
+
434
+ request_headers = {}
435
+
436
+ # Set Headers
437
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
438
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
439
+
440
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
441
+
442
+ # Serialize Request
443
+ request_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::SearchParameters.mapper()
444
+ request_content = @client.serialize(request_mapper, parameters)
445
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
446
+
447
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search'
448
+
449
+ request_url = @base_url || @client.base_url
450
+
451
+ options = {
452
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
453
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id},
454
+ query_params: {'api-version' => @client.api_version},
455
+ body: request_content,
456
+ headers: request_headers.merge(custom_headers || {}),
457
+ base_url: request_url
458
+ }
459
+ promise = @client.make_request_async(:post, path_template, options)
460
+
461
+ promise = promise.then do |result|
462
+ http_response = result.response
463
+ status_code = http_response.status
464
+ response_content = http_response.body
465
+ unless status_code == 200 || status_code == 202
466
+ error_model = JSON.load(response_content)
467
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
468
+ end
469
+
470
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
471
+ # Deserialize Response
472
+ if status_code == 200
473
+ begin
474
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
475
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::SearchResultsResponse.mapper()
476
+ result.body = @client.deserialize(result_mapper, parsed_response)
477
+ rescue Exception => e
478
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
479
+ end
480
+ end
481
+
482
+ result
483
+ end
484
+
485
+ promise.execute
486
+ end
487
+
488
+ end
489
+ end