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,857 @@
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 Workspaces
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Workspaces 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
+ # Get a list of workspaces which the current user has administrator privileges
26
+ # and are not associated with an Azure Subscription. The subscriptionId
27
+ # parameter in the Url is ignored.
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array] operation results.
33
+ #
34
+ def list_link_targets(custom_headers:nil)
35
+ response = list_link_targets_async(custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Get a list of workspaces which the current user has administrator privileges
41
+ # and are not associated with an Azure Subscription. The subscriptionId
42
+ # parameter in the Url is ignored.
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_link_targets_with_http_info(custom_headers:nil)
50
+ list_link_targets_async(custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Get a list of workspaces which the current user has administrator privileges
55
+ # and are not associated with an Azure Subscription. The subscriptionId
56
+ # parameter in the Url is ignored.
57
+ #
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_link_targets_async(custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+
67
+
68
+ request_headers = {}
69
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
70
+
71
+ # Set Headers
72
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
73
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
74
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/linkTargets'
75
+
76
+ request_url = @base_url || @client.base_url
77
+
78
+ options = {
79
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
80
+ path_params: {'subscriptionId' => @client.subscription_id},
81
+ query_params: {'api-version' => @client.api_version},
82
+ headers: request_headers.merge(custom_headers || {}),
83
+ base_url: request_url
84
+ }
85
+ promise = @client.make_request_async(:get, path_template, options)
86
+
87
+ promise = promise.then do |result|
88
+ http_response = result.response
89
+ status_code = http_response.status
90
+ response_content = http_response.body
91
+ unless status_code == 200
92
+ error_model = JSON.load(response_content)
93
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
94
+ end
95
+
96
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
97
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
98
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
99
+ # Deserialize Response
100
+ if status_code == 200
101
+ begin
102
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
103
+ result_mapper = {
104
+ client_side_validation: true,
105
+ required: false,
106
+ serialized_name: 'parsed_response',
107
+ type: {
108
+ name: 'Sequence',
109
+ element: {
110
+ client_side_validation: true,
111
+ required: false,
112
+ serialized_name: 'LinkTargetElementType',
113
+ type: {
114
+ name: 'Composite',
115
+ class_name: 'LinkTarget'
116
+ }
117
+ }
118
+ }
119
+ }
120
+ result.body = @client.deserialize(result_mapper, parsed_response)
121
+ rescue Exception => e
122
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
123
+ end
124
+ end
125
+
126
+ result
127
+ end
128
+
129
+ promise.execute
130
+ end
131
+
132
+ #
133
+ # Gets the schema for a given workspace.
134
+ #
135
+ # @param resource_group_name [String] The Resource Group name.
136
+ # @param workspace_name [String] The Log Analytics Workspace name.
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [SearchGetSchemaResponse] operation results.
141
+ #
142
+ def get_schema(resource_group_name, workspace_name, custom_headers:nil)
143
+ response = get_schema_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
144
+ response.body unless response.nil?
145
+ end
146
+
147
+ #
148
+ # Gets the schema 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 custom_headers [Hash{String => String}] A hash of custom headers that
153
+ # will be added to the HTTP request.
154
+ #
155
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
156
+ #
157
+ def get_schema_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
158
+ get_schema_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
159
+ end
160
+
161
+ #
162
+ # Gets the schema for a given workspace.
163
+ #
164
+ # @param resource_group_name [String] The Resource Group name.
165
+ # @param workspace_name [String] The Log Analytics Workspace name.
166
+ # @param [Hash{String => String}] A hash of custom headers that will be added
167
+ # to the HTTP request.
168
+ #
169
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
170
+ #
171
+ def get_schema_async(resource_group_name, workspace_name, custom_headers:nil)
172
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
173
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
174
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
175
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
176
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
177
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
178
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
179
+
180
+
181
+ request_headers = {}
182
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
183
+
184
+ # Set Headers
185
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
186
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
187
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema'
188
+
189
+ request_url = @base_url || @client.base_url
190
+
191
+ options = {
192
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
193
+ path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id},
194
+ query_params: {'api-version' => @client.api_version},
195
+ headers: request_headers.merge(custom_headers || {}),
196
+ base_url: request_url
197
+ }
198
+ promise = @client.make_request_async(:post, path_template, options)
199
+
200
+ promise = promise.then do |result|
201
+ http_response = result.response
202
+ status_code = http_response.status
203
+ response_content = http_response.body
204
+ unless status_code == 200
205
+ error_model = JSON.load(response_content)
206
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
207
+ end
208
+
209
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
210
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
211
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
212
+ # Deserialize Response
213
+ if status_code == 200
214
+ begin
215
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
216
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::SearchGetSchemaResponse.mapper()
217
+ result.body = @client.deserialize(result_mapper, parsed_response)
218
+ rescue Exception => e
219
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
220
+ end
221
+ end
222
+
223
+ result
224
+ end
225
+
226
+ promise.execute
227
+ end
228
+
229
+ #
230
+ # Purges data in an Log Analytics workspace by a set of user-defined filters.
231
+ #
232
+ # In order to manage system resources, purge requests are throttled at 50
233
+ # requests per hour. You should batch the execution of purge requests by
234
+ # sending a single command whose predicate includes all user identities that
235
+ # require purging. Use the in operator to specify multiple identities. You
236
+ # should run the query prior to using for a purge request to verify that the
237
+ # results are expected.
238
+ #
239
+ # @param resource_group_name [String] The Resource Group name.
240
+ # @param workspace_name [String] The Log Analytics Workspace name.
241
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
242
+ # will be added to the HTTP request.
243
+ #
244
+ # @return [WorkspacePurgeResponse] operation results.
245
+ #
246
+ def purge(resource_group_name, workspace_name, custom_headers:nil)
247
+ response = purge_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
248
+ response.body unless response.nil?
249
+ end
250
+
251
+ #
252
+ # Purges data in an Log Analytics workspace by a set of user-defined filters.
253
+ #
254
+ # In order to manage system resources, purge requests are throttled at 50
255
+ # requests per hour. You should batch the execution of purge requests by
256
+ # sending a single command whose predicate includes all user identities that
257
+ # require purging. Use the in operator to specify multiple identities. You
258
+ # should run the query prior to using for a purge request to verify that the
259
+ # results are expected.
260
+ #
261
+ # @param resource_group_name [String] The Resource Group name.
262
+ # @param workspace_name [String] The Log Analytics Workspace name.
263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
264
+ # will be added to the HTTP request.
265
+ #
266
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
267
+ #
268
+ def purge_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
269
+ purge_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
270
+ end
271
+
272
+ #
273
+ # Purges data in an Log Analytics workspace by a set of user-defined filters.
274
+ #
275
+ # In order to manage system resources, purge requests are throttled at 50
276
+ # requests per hour. You should batch the execution of purge requests by
277
+ # sending a single command whose predicate includes all user identities that
278
+ # require purging. Use the in operator to specify multiple identities. You
279
+ # should run the query prior to using for a purge request to verify that the
280
+ # results are expected.
281
+ #
282
+ # @param resource_group_name [String] The Resource Group name.
283
+ # @param workspace_name [String] The Log Analytics Workspace name.
284
+ # @param [Hash{String => String}] A hash of custom headers that will be added
285
+ # to the HTTP request.
286
+ #
287
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
288
+ #
289
+ def purge_async(resource_group_name, workspace_name, custom_headers:nil)
290
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
291
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
292
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
293
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
294
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
295
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
296
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
297
+ fail ArgumentError, '@client.body is nil' if @client.body.nil?
298
+
299
+
300
+ request_headers = {}
301
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
302
+
303
+ # Set Headers
304
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
305
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
306
+
307
+ # Serialize Request
308
+ request_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::WorkspacePurgeBody.mapper()
309
+ request_content = @client.serialize(request_mapper, @client.body)
310
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
311
+
312
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge'
313
+
314
+ request_url = @base_url || @client.base_url
315
+
316
+ options = {
317
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
318
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'workspaceName' => workspace_name},
319
+ query_params: {'api-version' => @client.api_version},
320
+ body: request_content,
321
+ headers: request_headers.merge(custom_headers || {}),
322
+ base_url: request_url
323
+ }
324
+ promise = @client.make_request_async(:post, path_template, options)
325
+
326
+ promise = promise.then do |result|
327
+ http_response = result.response
328
+ status_code = http_response.status
329
+ response_content = http_response.body
330
+ unless status_code == 202
331
+ error_model = JSON.load(response_content)
332
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
333
+ end
334
+
335
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
336
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
337
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
338
+ # Deserialize Response
339
+ if status_code == 202
340
+ begin
341
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
342
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::WorkspacePurgeResponse.mapper()
343
+ result.body = @client.deserialize(result_mapper, parsed_response)
344
+ rescue Exception => e
345
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
346
+ end
347
+ end
348
+
349
+ result
350
+ end
351
+
352
+ promise.execute
353
+ end
354
+
355
+ #
356
+ # Gets status of an ongoing purge operation.
357
+ #
358
+ # @param resource_group_name [String] The Resource Group name.
359
+ # @param workspace_name [String] The Log Analytics Workspace name.
360
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
361
+ # will be added to the HTTP request.
362
+ #
363
+ # @return [WorkspacePurgeStatusResponse] operation results.
364
+ #
365
+ def get_purge_status(resource_group_name, workspace_name, custom_headers:nil)
366
+ response = get_purge_status_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
367
+ response.body unless response.nil?
368
+ end
369
+
370
+ #
371
+ # Gets status of an ongoing purge operation.
372
+ #
373
+ # @param resource_group_name [String] The Resource Group name.
374
+ # @param workspace_name [String] The Log Analytics Workspace name.
375
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
376
+ # will be added to the HTTP request.
377
+ #
378
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
379
+ #
380
+ def get_purge_status_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
381
+ get_purge_status_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
382
+ end
383
+
384
+ #
385
+ # Gets status of an ongoing purge operation.
386
+ #
387
+ # @param resource_group_name [String] The Resource Group name.
388
+ # @param workspace_name [String] The Log Analytics Workspace name.
389
+ # @param [Hash{String => String}] A hash of custom headers that will be added
390
+ # to the HTTP request.
391
+ #
392
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
393
+ #
394
+ def get_purge_status_async(resource_group_name, workspace_name, custom_headers:nil)
395
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
396
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
397
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
398
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
399
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
400
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
401
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
402
+ fail ArgumentError, '@client.purge_id is nil' if @client.purge_id.nil?
403
+
404
+
405
+ request_headers = {}
406
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
407
+
408
+ # Set Headers
409
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
410
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
411
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}'
412
+
413
+ request_url = @base_url || @client.base_url
414
+
415
+ options = {
416
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
417
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'workspaceName' => workspace_name,'purgeId' => @client.purge_id},
418
+ query_params: {'api-version' => @client.api_version},
419
+ headers: request_headers.merge(custom_headers || {}),
420
+ base_url: request_url
421
+ }
422
+ promise = @client.make_request_async(:get, path_template, options)
423
+
424
+ promise = promise.then do |result|
425
+ http_response = result.response
426
+ status_code = http_response.status
427
+ response_content = http_response.body
428
+ unless status_code == 200
429
+ error_model = JSON.load(response_content)
430
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
431
+ end
432
+
433
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
434
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
435
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
436
+ # Deserialize Response
437
+ if status_code == 200
438
+ begin
439
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
440
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::WorkspacePurgeStatusResponse.mapper()
441
+ result.body = @client.deserialize(result_mapper, parsed_response)
442
+ rescue Exception => e
443
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
444
+ end
445
+ end
446
+
447
+ result
448
+ end
449
+
450
+ promise.execute
451
+ end
452
+
453
+ #
454
+ # Gets the shared keys for a Log Analytics Workspace. These keys are used to
455
+ # connect Microsoft Operational Insights agents to the workspace.
456
+ #
457
+ # @param resource_group_name [String] The Resource Group name.
458
+ # @param workspace_name [String] The Log Analytics Workspace name.
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [SharedKeys] operation results.
463
+ #
464
+ def list_keys(resource_group_name, workspace_name, custom_headers:nil)
465
+ response = list_keys_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
466
+ response.body unless response.nil?
467
+ end
468
+
469
+ #
470
+ # Gets the shared keys for a Log Analytics Workspace. These keys are used to
471
+ # connect Microsoft Operational Insights agents to the workspace.
472
+ #
473
+ # @param resource_group_name [String] The Resource Group name.
474
+ # @param workspace_name [String] The Log Analytics Workspace name.
475
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
476
+ # will be added to the HTTP request.
477
+ #
478
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
479
+ #
480
+ def list_keys_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
481
+ list_keys_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
482
+ end
483
+
484
+ #
485
+ # Gets the shared keys for a Log Analytics Workspace. These keys are used to
486
+ # connect Microsoft Operational Insights agents to the workspace.
487
+ #
488
+ # @param resource_group_name [String] The Resource Group name.
489
+ # @param workspace_name [String] The Log Analytics Workspace name.
490
+ # @param [Hash{String => String}] A hash of custom headers that will be added
491
+ # to the HTTP request.
492
+ #
493
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
494
+ #
495
+ def list_keys_async(resource_group_name, workspace_name, custom_headers:nil)
496
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
497
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
498
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
499
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
500
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
501
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
502
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
503
+
504
+
505
+ request_headers = {}
506
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
507
+
508
+ # Set Headers
509
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
510
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
511
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/listKeys'
512
+
513
+ request_url = @base_url || @client.base_url
514
+
515
+ options = {
516
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
517
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
518
+ query_params: {'api-version' => @client.api_version},
519
+ headers: request_headers.merge(custom_headers || {}),
520
+ base_url: request_url
521
+ }
522
+ promise = @client.make_request_async(:post, path_template, options)
523
+
524
+ promise = promise.then do |result|
525
+ http_response = result.response
526
+ status_code = http_response.status
527
+ response_content = http_response.body
528
+ unless status_code == 200
529
+ error_model = JSON.load(response_content)
530
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
531
+ end
532
+
533
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
534
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
535
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
536
+ # Deserialize Response
537
+ if status_code == 200
538
+ begin
539
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
540
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::SharedKeys.mapper()
541
+ result.body = @client.deserialize(result_mapper, parsed_response)
542
+ rescue Exception => e
543
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
544
+ end
545
+ end
546
+
547
+ result
548
+ end
549
+
550
+ promise.execute
551
+ end
552
+
553
+ #
554
+ # Regenerates the shared keys for a Log Analytics Workspace. These keys are
555
+ # used to connect Microsoft Operational Insights agents to the workspace.
556
+ #
557
+ # @param resource_group_name [String] The Resource Group name.
558
+ # @param workspace_name [String] The Log Analytics Workspace name.
559
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
560
+ # will be added to the HTTP request.
561
+ #
562
+ # @return [SharedKeys] operation results.
563
+ #
564
+ def regenerate_shared_keys(resource_group_name, workspace_name, custom_headers:nil)
565
+ response = regenerate_shared_keys_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
566
+ response.body unless response.nil?
567
+ end
568
+
569
+ #
570
+ # Regenerates the shared keys for a Log Analytics Workspace. These keys are
571
+ # used to connect Microsoft Operational Insights agents to the workspace.
572
+ #
573
+ # @param resource_group_name [String] The Resource Group name.
574
+ # @param workspace_name [String] The Log Analytics Workspace name.
575
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
576
+ # will be added to the HTTP request.
577
+ #
578
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
579
+ #
580
+ def regenerate_shared_keys_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
581
+ regenerate_shared_keys_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
582
+ end
583
+
584
+ #
585
+ # Regenerates the shared keys for a Log Analytics Workspace. These keys are
586
+ # used to connect Microsoft Operational Insights agents to the workspace.
587
+ #
588
+ # @param resource_group_name [String] The Resource Group name.
589
+ # @param workspace_name [String] The Log Analytics Workspace name.
590
+ # @param [Hash{String => String}] A hash of custom headers that will be added
591
+ # to the HTTP request.
592
+ #
593
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
594
+ #
595
+ def regenerate_shared_keys_async(resource_group_name, workspace_name, custom_headers:nil)
596
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
597
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
598
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
599
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
600
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
601
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
602
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
603
+
604
+
605
+ request_headers = {}
606
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
607
+
608
+ # Set Headers
609
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
610
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
611
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey'
612
+
613
+ request_url = @base_url || @client.base_url
614
+
615
+ options = {
616
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
617
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
618
+ query_params: {'api-version' => @client.api_version},
619
+ headers: request_headers.merge(custom_headers || {}),
620
+ base_url: request_url
621
+ }
622
+ promise = @client.make_request_async(:post, path_template, options)
623
+
624
+ promise = promise.then do |result|
625
+ http_response = result.response
626
+ status_code = http_response.status
627
+ response_content = http_response.body
628
+ unless status_code == 200
629
+ error_model = JSON.load(response_content)
630
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
631
+ end
632
+
633
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
634
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
635
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
636
+ # Deserialize Response
637
+ if status_code == 200
638
+ begin
639
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
640
+ result_mapper = Azure::OperationalInsights::Mgmt::V2015_03_20::Models::SharedKeys.mapper()
641
+ result.body = @client.deserialize(result_mapper, parsed_response)
642
+ rescue Exception => e
643
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
644
+ end
645
+ end
646
+
647
+ result
648
+ end
649
+
650
+ promise.execute
651
+ end
652
+
653
+ #
654
+ # Delete a Log Analytics gateway.
655
+ #
656
+ # @param resource_group_name [String] The Resource Group name.
657
+ # @param workspace_name [String] The Log Analytics Workspace name.
658
+ # @param gateway_id [String] The Log Analytics gateway Id.
659
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
660
+ # will be added to the HTTP request.
661
+ #
662
+ #
663
+ def delete_gateways(resource_group_name, workspace_name, gateway_id, custom_headers:nil)
664
+ response = delete_gateways_async(resource_group_name, workspace_name, gateway_id, custom_headers:custom_headers).value!
665
+ nil
666
+ end
667
+
668
+ #
669
+ # Delete a Log Analytics gateway.
670
+ #
671
+ # @param resource_group_name [String] The Resource Group name.
672
+ # @param workspace_name [String] The Log Analytics Workspace name.
673
+ # @param gateway_id [String] The Log Analytics gateway Id.
674
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
675
+ # will be added to the HTTP request.
676
+ #
677
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
678
+ #
679
+ def delete_gateways_with_http_info(resource_group_name, workspace_name, gateway_id, custom_headers:nil)
680
+ delete_gateways_async(resource_group_name, workspace_name, gateway_id, custom_headers:custom_headers).value!
681
+ end
682
+
683
+ #
684
+ # Delete a Log Analytics gateway.
685
+ #
686
+ # @param resource_group_name [String] The Resource Group name.
687
+ # @param workspace_name [String] The Log Analytics Workspace name.
688
+ # @param gateway_id [String] The Log Analytics gateway Id.
689
+ # @param [Hash{String => String}] A hash of custom headers that will be added
690
+ # to the HTTP request.
691
+ #
692
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
693
+ #
694
+ def delete_gateways_async(resource_group_name, workspace_name, gateway_id, custom_headers:nil)
695
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
696
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
697
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
698
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
699
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
700
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
701
+ fail ArgumentError, 'gateway_id is nil' if gateway_id.nil?
702
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
703
+
704
+
705
+ request_headers = {}
706
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
707
+
708
+ # Set Headers
709
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
710
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
711
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}'
712
+
713
+ request_url = @base_url || @client.base_url
714
+
715
+ options = {
716
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
717
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'gatewayId' => gateway_id},
718
+ query_params: {'api-version' => @client.api_version},
719
+ headers: request_headers.merge(custom_headers || {}),
720
+ base_url: request_url
721
+ }
722
+ promise = @client.make_request_async(:delete, path_template, options)
723
+
724
+ promise = promise.then do |result|
725
+ http_response = result.response
726
+ status_code = http_response.status
727
+ response_content = http_response.body
728
+ unless status_code == 200
729
+ error_model = JSON.load(response_content)
730
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
731
+ end
732
+
733
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
734
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
735
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
736
+
737
+ result
738
+ end
739
+
740
+ promise.execute
741
+ end
742
+
743
+ #
744
+ # Gets the available service tiers for the workspace.
745
+ #
746
+ # @param resource_group_name [String] The Resource Group name.
747
+ # @param workspace_name [String] The Log Analytics Workspace name.
748
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
749
+ # will be added to the HTTP request.
750
+ #
751
+ # @return [Array] operation results.
752
+ #
753
+ def available_service_tiers(resource_group_name, workspace_name, custom_headers:nil)
754
+ response = available_service_tiers_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
755
+ response.body unless response.nil?
756
+ end
757
+
758
+ #
759
+ # Gets the available service tiers for the workspace.
760
+ #
761
+ # @param resource_group_name [String] The Resource Group name.
762
+ # @param workspace_name [String] The Log Analytics Workspace name.
763
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
764
+ # will be added to the HTTP request.
765
+ #
766
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
767
+ #
768
+ def available_service_tiers_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
769
+ available_service_tiers_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
770
+ end
771
+
772
+ #
773
+ # Gets the available service tiers for the workspace.
774
+ #
775
+ # @param resource_group_name [String] The Resource Group name.
776
+ # @param workspace_name [String] The Log Analytics Workspace name.
777
+ # @param [Hash{String => String}] A hash of custom headers that will be added
778
+ # to the HTTP request.
779
+ #
780
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
781
+ #
782
+ def available_service_tiers_async(resource_group_name, workspace_name, custom_headers:nil)
783
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
784
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
785
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
786
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
787
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
788
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
789
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
790
+
791
+
792
+ request_headers = {}
793
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
794
+
795
+ # Set Headers
796
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
797
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
798
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers'
799
+
800
+ request_url = @base_url || @client.base_url
801
+
802
+ options = {
803
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
804
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
805
+ query_params: {'api-version' => @client.api_version},
806
+ headers: request_headers.merge(custom_headers || {}),
807
+ base_url: request_url
808
+ }
809
+ promise = @client.make_request_async(:get, path_template, options)
810
+
811
+ promise = promise.then do |result|
812
+ http_response = result.response
813
+ status_code = http_response.status
814
+ response_content = http_response.body
815
+ unless status_code == 200
816
+ error_model = JSON.load(response_content)
817
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
818
+ end
819
+
820
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
821
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
822
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
823
+ # Deserialize Response
824
+ if status_code == 200
825
+ begin
826
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
827
+ result_mapper = {
828
+ client_side_validation: true,
829
+ required: false,
830
+ serialized_name: 'parsed_response',
831
+ type: {
832
+ name: 'Sequence',
833
+ element: {
834
+ client_side_validation: true,
835
+ required: false,
836
+ serialized_name: 'AvailableServiceTierElementType',
837
+ type: {
838
+ name: 'Composite',
839
+ class_name: 'AvailableServiceTier'
840
+ }
841
+ }
842
+ }
843
+ }
844
+ result.body = @client.deserialize(result_mapper, parsed_response)
845
+ rescue Exception => e
846
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
847
+ end
848
+ end
849
+
850
+ result
851
+ end
852
+
853
+ promise.execute
854
+ end
855
+
856
+ end
857
+ end