azure_mgmt_operational_insights 0.19.1 → 0.19.2

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