azure_mgmt_operational_insights 0.17.2 → 0.18.0

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