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,481 @@
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 LinkedStorageAccounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the LinkedStorageAccounts 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 link relation between current workspace and a group of
26
+ # storage accounts of a specific data source type.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group. The name
29
+ # is case insensitive.
30
+ # @param workspace_name [String] The name of the workspace.
31
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
32
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
33
+ # @param parameters [LinkedStorageAccountsResource] The parameters required to
34
+ # create or update linked storage accounts.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [LinkedStorageAccountsResource] operation results.
39
+ #
40
+ def create_or_update(resource_group_name, workspace_name, data_source_type, parameters, custom_headers:nil)
41
+ response = create_or_update_async(resource_group_name, workspace_name, data_source_type, parameters, custom_headers:custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Create or Update a link relation between current workspace and a group of
47
+ # storage accounts of a specific data source type.
48
+ #
49
+ # @param resource_group_name [String] The name of the resource group. The name
50
+ # is case insensitive.
51
+ # @param workspace_name [String] The name of the workspace.
52
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
53
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
54
+ # @param parameters [LinkedStorageAccountsResource] The parameters required to
55
+ # create or update linked storage accounts.
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, data_source_type, parameters, custom_headers:nil)
62
+ create_or_update_async(resource_group_name, workspace_name, data_source_type, parameters, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Create or Update a link relation between current workspace and a group of
67
+ # storage accounts of a specific data source type.
68
+ #
69
+ # @param resource_group_name [String] The name of the resource group. The name
70
+ # is case insensitive.
71
+ # @param workspace_name [String] The name of the workspace.
72
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
73
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
74
+ # @param parameters [LinkedStorageAccountsResource] The parameters required to
75
+ # create or update linked storage accounts.
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, data_source_type, parameters, custom_headers:nil)
82
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
83
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
84
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
85
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
86
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
87
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
88
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
89
+ 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?
90
+ fail ArgumentError, 'data_source_type is nil' if data_source_type.nil?
91
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
92
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
93
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
94
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
95
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
96
+
97
+
98
+ request_headers = {}
99
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
100
+
101
+ # Set Headers
102
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
103
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
104
+
105
+ # Serialize Request
106
+ request_mapper = Azure::OperationalInsights::Mgmt::V2020_08_01::Models::LinkedStorageAccountsResource.mapper()
107
+ request_content = @client.serialize(request_mapper, parameters)
108
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
109
+
110
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'
111
+
112
+ request_url = @base_url || @client.base_url
113
+
114
+ options = {
115
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
116
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'dataSourceType' => data_source_type,'subscriptionId' => @client.subscription_id},
117
+ query_params: {'api-version' => @client.api_version},
118
+ body: request_content,
119
+ headers: request_headers.merge(custom_headers || {}),
120
+ base_url: request_url
121
+ }
122
+ promise = @client.make_request_async(:put, path_template, options)
123
+
124
+ promise = promise.then do |result|
125
+ http_response = result.response
126
+ status_code = http_response.status
127
+ response_content = http_response.body
128
+ unless status_code == 200
129
+ error_model = JSON.load(response_content)
130
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
131
+ end
132
+
133
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
134
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
135
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
136
+ # Deserialize Response
137
+ if status_code == 200
138
+ begin
139
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
140
+ result_mapper = Azure::OperationalInsights::Mgmt::V2020_08_01::Models::LinkedStorageAccountsResource.mapper()
141
+ result.body = @client.deserialize(result_mapper, parsed_response)
142
+ rescue Exception => e
143
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
144
+ end
145
+ end
146
+
147
+ result
148
+ end
149
+
150
+ promise.execute
151
+ end
152
+
153
+ #
154
+ # Deletes all linked storage accounts of a specific data source type associated
155
+ # with the specified workspace.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group. The name
158
+ # is case insensitive.
159
+ # @param workspace_name [String] The name of the workspace.
160
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
161
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ #
166
+ def delete(resource_group_name, workspace_name, data_source_type, custom_headers:nil)
167
+ response = delete_async(resource_group_name, workspace_name, data_source_type, custom_headers:custom_headers).value!
168
+ nil
169
+ end
170
+
171
+ #
172
+ # Deletes all linked storage accounts of a specific data source type associated
173
+ # with the specified workspace.
174
+ #
175
+ # @param resource_group_name [String] The name of the resource group. The name
176
+ # is case insensitive.
177
+ # @param workspace_name [String] The name of the workspace.
178
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
179
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
180
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
181
+ # will be added to the HTTP request.
182
+ #
183
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
184
+ #
185
+ def delete_with_http_info(resource_group_name, workspace_name, data_source_type, custom_headers:nil)
186
+ delete_async(resource_group_name, workspace_name, data_source_type, custom_headers:custom_headers).value!
187
+ end
188
+
189
+ #
190
+ # Deletes all linked storage accounts of a specific data source type associated
191
+ # with the specified workspace.
192
+ #
193
+ # @param resource_group_name [String] The name of the resource group. The name
194
+ # is case insensitive.
195
+ # @param workspace_name [String] The name of the workspace.
196
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
197
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
198
+ # @param [Hash{String => String}] A hash of custom headers that will be added
199
+ # to the HTTP request.
200
+ #
201
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
202
+ #
203
+ def delete_async(resource_group_name, workspace_name, data_source_type, custom_headers:nil)
204
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
205
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
206
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
207
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
208
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
209
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
210
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
211
+ 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?
212
+ fail ArgumentError, 'data_source_type is nil' if data_source_type.nil?
213
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
214
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
215
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
216
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
217
+
218
+
219
+ request_headers = {}
220
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
221
+
222
+ # Set Headers
223
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
224
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
225
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'
226
+
227
+ request_url = @base_url || @client.base_url
228
+
229
+ options = {
230
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
231
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'dataSourceType' => data_source_type,'subscriptionId' => @client.subscription_id},
232
+ query_params: {'api-version' => @client.api_version},
233
+ headers: request_headers.merge(custom_headers || {}),
234
+ base_url: request_url
235
+ }
236
+ promise = @client.make_request_async(:delete, path_template, options)
237
+
238
+ promise = promise.then do |result|
239
+ http_response = result.response
240
+ status_code = http_response.status
241
+ response_content = http_response.body
242
+ unless status_code == 200
243
+ error_model = JSON.load(response_content)
244
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
245
+ end
246
+
247
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
248
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
249
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
250
+
251
+ result
252
+ end
253
+
254
+ promise.execute
255
+ end
256
+
257
+ #
258
+ # Gets all linked storage account of a specific data source type associated
259
+ # with the specified workspace.
260
+ #
261
+ # @param resource_group_name [String] The name of the resource group. The name
262
+ # is case insensitive.
263
+ # @param workspace_name [String] The name of the workspace.
264
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
265
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
266
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
267
+ # will be added to the HTTP request.
268
+ #
269
+ # @return [LinkedStorageAccountsResource] operation results.
270
+ #
271
+ def get(resource_group_name, workspace_name, data_source_type, custom_headers:nil)
272
+ response = get_async(resource_group_name, workspace_name, data_source_type, custom_headers:custom_headers).value!
273
+ response.body unless response.nil?
274
+ end
275
+
276
+ #
277
+ # Gets all linked storage account of a specific data source type associated
278
+ # with the specified workspace.
279
+ #
280
+ # @param resource_group_name [String] The name of the resource group. The name
281
+ # is case insensitive.
282
+ # @param workspace_name [String] The name of the workspace.
283
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
284
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
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 get_with_http_info(resource_group_name, workspace_name, data_source_type, custom_headers:nil)
291
+ get_async(resource_group_name, workspace_name, data_source_type, custom_headers:custom_headers).value!
292
+ end
293
+
294
+ #
295
+ # Gets all linked storage account of a specific data source type associated
296
+ # with the specified workspace.
297
+ #
298
+ # @param resource_group_name [String] The name of the resource group. The name
299
+ # is case insensitive.
300
+ # @param workspace_name [String] The name of the workspace.
301
+ # @param data_source_type [DataSourceType] Linked storage accounts type.
302
+ # Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts'
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 get_async(resource_group_name, workspace_name, data_source_type, custom_headers:nil)
309
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
310
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
311
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
312
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
313
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
314
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
315
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
316
+ 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?
317
+ fail ArgumentError, 'data_source_type is nil' if data_source_type.nil?
318
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
319
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
320
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
321
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
322
+
323
+
324
+ request_headers = {}
325
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
326
+
327
+ # Set Headers
328
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
329
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
330
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'
331
+
332
+ request_url = @base_url || @client.base_url
333
+
334
+ options = {
335
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
336
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'dataSourceType' => data_source_type,'subscriptionId' => @client.subscription_id},
337
+ query_params: {'api-version' => @client.api_version},
338
+ headers: request_headers.merge(custom_headers || {}),
339
+ base_url: request_url
340
+ }
341
+ promise = @client.make_request_async(:get, path_template, options)
342
+
343
+ promise = promise.then do |result|
344
+ http_response = result.response
345
+ status_code = http_response.status
346
+ response_content = http_response.body
347
+ unless status_code == 200
348
+ error_model = JSON.load(response_content)
349
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
350
+ end
351
+
352
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
353
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
354
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_08_01::Models::LinkedStorageAccountsResource.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
+ # Gets all linked storage accounts associated with the specified workspace,
374
+ # storage accounts will be sorted by their data source type.
375
+ #
376
+ # @param resource_group_name [String] The name of the resource group. The name
377
+ # is case insensitive.
378
+ # @param workspace_name [String] The name of the workspace.
379
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
380
+ # will be added to the HTTP request.
381
+ #
382
+ # @return [LinkedStorageAccountsListResult] operation results.
383
+ #
384
+ def list_by_workspace(resource_group_name, workspace_name, custom_headers:nil)
385
+ response = list_by_workspace_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
386
+ response.body unless response.nil?
387
+ end
388
+
389
+ #
390
+ # Gets all linked storage accounts associated with the specified workspace,
391
+ # storage accounts will be sorted by their data source type.
392
+ #
393
+ # @param resource_group_name [String] The name of the resource group. The name
394
+ # is case insensitive.
395
+ # @param workspace_name [String] The name of the workspace.
396
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
397
+ # will be added to the HTTP request.
398
+ #
399
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
400
+ #
401
+ def list_by_workspace_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
402
+ list_by_workspace_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
403
+ end
404
+
405
+ #
406
+ # Gets all linked storage accounts associated with the specified workspace,
407
+ # storage accounts will be sorted by their data source type.
408
+ #
409
+ # @param resource_group_name [String] The name of the resource group. The name
410
+ # is case insensitive.
411
+ # @param workspace_name [String] The name of the workspace.
412
+ # @param [Hash{String => String}] A hash of custom headers that will be added
413
+ # to the HTTP request.
414
+ #
415
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
416
+ #
417
+ def list_by_workspace_async(resource_group_name, workspace_name, custom_headers:nil)
418
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
419
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
420
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
421
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
422
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
423
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
424
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
425
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
426
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
427
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
428
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
429
+ 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?
430
+
431
+
432
+ request_headers = {}
433
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
434
+
435
+ # Set Headers
436
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
437
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
438
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts'
439
+
440
+ request_url = @base_url || @client.base_url
441
+
442
+ options = {
443
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
444
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
445
+ query_params: {'api-version' => @client.api_version},
446
+ headers: request_headers.merge(custom_headers || {}),
447
+ base_url: request_url
448
+ }
449
+ promise = @client.make_request_async(:get, path_template, options)
450
+
451
+ promise = promise.then do |result|
452
+ http_response = result.response
453
+ status_code = http_response.status
454
+ response_content = http_response.body
455
+ unless status_code == 200
456
+ error_model = JSON.load(response_content)
457
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
458
+ end
459
+
460
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
461
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
462
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
463
+ # Deserialize Response
464
+ if status_code == 200
465
+ begin
466
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
467
+ result_mapper = Azure::OperationalInsights::Mgmt::V2020_08_01::Models::LinkedStorageAccountsListResult.mapper()
468
+ result.body = @client.deserialize(result_mapper, parsed_response)
469
+ rescue Exception => e
470
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
471
+ end
472
+ end
473
+
474
+ result
475
+ end
476
+
477
+ promise.execute
478
+ end
479
+
480
+ end
481
+ end