azure_mgmt_operational_insights 0.16.0 → 0.19.0

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