azure_mgmt_operational_insights 0.19.1

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