azure_mgmt_monitor 0.17.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  3. data/lib/2016-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  4. data/lib/2016-09-01/generated/azure_mgmt_monitor/monitor_client.rb +1 -1
  5. data/lib/2017-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  6. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  7. data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  8. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor.rb +32 -0
  9. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/metric_namespaces.rb +118 -0
  10. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  11. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/models/metric_namespace.rb +81 -0
  12. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/models/metric_namespace_collection.rb +55 -0
  13. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/models/metric_namespace_name.rb +46 -0
  14. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  15. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +128 -0
  16. data/lib/2018-01-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  17. data/lib/2018-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  18. data/lib/2018-04-16/generated/azure_mgmt_monitor/monitor_client.rb +1 -1
  19. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor.rb +44 -0
  20. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/guest_diagnostics_settings.rb +602 -0
  21. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/guest_diagnostics_settings_association.rb +622 -0
  22. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/data_source.rb +80 -0
  23. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/data_source_configuration.rb +98 -0
  24. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  25. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/etw_event_configuration.rb +69 -0
  26. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/etw_provider_configuration.rb +67 -0
  27. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/event_log_configuration.rb +58 -0
  28. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/guest_diagnostic_settings_association_list.rb +68 -0
  29. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/guest_diagnostic_settings_association_resource.rb +98 -0
  30. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/guest_diagnostic_settings_association_resource_patch.rb +66 -0
  31. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/guest_diagnostic_settings_list.rb +68 -0
  32. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/guest_diagnostic_settings_patch_resource.rb +98 -0
  33. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/guest_diagnostic_settings_resource.rb +130 -0
  34. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/performance_counter_configuration.rb +69 -0
  35. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/resource.rb +110 -0
  36. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/models/sink_configuration.rb +48 -0
  37. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  38. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +136 -0
  39. data/lib/2018-09-01/generated/azure_mgmt_monitor.rb +54 -0
  40. data/lib/2018-09-01/generated/azure_mgmt_monitor/action_groups.rb +693 -0
  41. data/lib/2018-09-01/generated/azure_mgmt_monitor/metric_baseline.rb +290 -0
  42. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/action_group_list.rb +67 -0
  43. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/action_group_patch_body.rb +68 -0
  44. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/action_group_resource.rb +326 -0
  45. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/arm_role_receiver.rb +58 -0
  46. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/automation_runbook_receiver.rb +102 -0
  47. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/azure_app_push_receiver.rb +58 -0
  48. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/azure_function_receiver.rb +80 -0
  49. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/baseline.rb +86 -0
  50. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/baseline_metadata_value.rb +58 -0
  51. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/baseline_response.rb +171 -0
  52. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/calculate_baseline_response.rb +85 -0
  53. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/email_receiver.rb +72 -0
  54. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/enable_request.rb +46 -0
  55. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  56. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/itsm_receiver.rb +94 -0
  57. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/localizable_string.rb +57 -0
  58. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/logic_app_receiver.rb +69 -0
  59. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/receiver_status.rb +17 -0
  60. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/resource.rb +110 -0
  61. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/result_type.rb +16 -0
  62. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/sensitivity.rb +17 -0
  63. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/sms_receiver.rb +83 -0
  64. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/time_series_information.rb +93 -0
  65. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/voice_receiver.rb +69 -0
  66. data/lib/2018-09-01/generated/azure_mgmt_monitor/models/webhook_receiver.rb +58 -0
  67. data/lib/2018-09-01/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  68. data/lib/2018-09-01/generated/azure_mgmt_monitor/monitor_management_client.rb +135 -0
  69. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor.rb +36 -0
  70. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/models/data_container.rb +47 -0
  71. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/models/data_status.rb +16 -0
  72. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/models/error.rb +57 -0
  73. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/models/onboarding_status.rb +17 -0
  74. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/models/proxy_resource.rb +71 -0
  75. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/models/response_with_error.rb +47 -0
  76. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/models/vminsights_onboarding_status.rb +123 -0
  77. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/models/workspace_info.rb +69 -0
  78. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  79. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +128 -0
  80. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/vminsights.rb +118 -0
  81. data/lib/2019-03-01/generated/azure_mgmt_monitor.rb +45 -0
  82. data/lib/2019-03-01/generated/azure_mgmt_monitor/action_groups.rb +693 -0
  83. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/action_group_list.rb +67 -0
  84. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/action_group_patch_body.rb +68 -0
  85. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/action_group_resource.rb +326 -0
  86. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/arm_role_receiver.rb +69 -0
  87. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/automation_runbook_receiver.rb +113 -0
  88. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/azure_app_push_receiver.rb +58 -0
  89. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/azure_function_receiver.rb +91 -0
  90. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/email_receiver.rb +83 -0
  91. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/enable_request.rb +46 -0
  92. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  93. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/itsm_receiver.rb +94 -0
  94. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/logic_app_receiver.rb +80 -0
  95. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/receiver_status.rb +17 -0
  96. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/resource.rb +110 -0
  97. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/sms_receiver.rb +83 -0
  98. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/voice_receiver.rb +69 -0
  99. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/webhook_receiver.rb +69 -0
  100. data/lib/2019-03-01/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  101. data/lib/2019-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +131 -0
  102. data/lib/azure_mgmt_monitor.rb +5 -0
  103. data/lib/profiles/latest/modules/monitor_profile_module.rb +332 -106
  104. data/lib/version.rb +1 -1
  105. metadata +92 -1
@@ -0,0 +1,622 @@
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::Monitor::Mgmt::V2018_06_01_preview
7
+ #
8
+ # GuestDiagnosticsSettingsAssociation
9
+ #
10
+ class GuestDiagnosticsSettingsAssociation
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the GuestDiagnosticsSettingsAssociation class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [MonitorManagementClient] reference to the MonitorManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates or updates guest diagnostics settings association.
26
+ #
27
+ # @param resource_uri [String] The fully qualified ID of the resource,
28
+ # including the resource name and resource type.
29
+ # @param association_name [String] The name of the diagnostic settings
30
+ # association.
31
+ # @param diagnostic_settings_association
32
+ # [GuestDiagnosticSettingsAssociationResource] The diagnostic settings
33
+ # association to create or update.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [GuestDiagnosticSettingsAssociationResource] operation results.
38
+ #
39
+ def create_or_update(resource_uri, association_name, diagnostic_settings_association, custom_headers:nil)
40
+ response = create_or_update_async(resource_uri, association_name, diagnostic_settings_association, custom_headers:custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # Creates or updates guest diagnostics settings association.
46
+ #
47
+ # @param resource_uri [String] The fully qualified ID of the resource,
48
+ # including the resource name and resource type.
49
+ # @param association_name [String] The name of the diagnostic settings
50
+ # association.
51
+ # @param diagnostic_settings_association
52
+ # [GuestDiagnosticSettingsAssociationResource] The diagnostic settings
53
+ # association to create or update.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def create_or_update_with_http_info(resource_uri, association_name, diagnostic_settings_association, custom_headers:nil)
60
+ create_or_update_async(resource_uri, association_name, diagnostic_settings_association, custom_headers:custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # Creates or updates guest diagnostics settings association.
65
+ #
66
+ # @param resource_uri [String] The fully qualified ID of the resource,
67
+ # including the resource name and resource type.
68
+ # @param association_name [String] The name of the diagnostic settings
69
+ # association.
70
+ # @param diagnostic_settings_association
71
+ # [GuestDiagnosticSettingsAssociationResource] The diagnostic settings
72
+ # association to create or update.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def create_or_update_async(resource_uri, association_name, diagnostic_settings_association, custom_headers:nil)
79
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
80
+ fail ArgumentError, 'association_name is nil' if association_name.nil?
81
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
82
+ fail ArgumentError, 'diagnostic_settings_association is nil' if diagnostic_settings_association.nil?
83
+
84
+
85
+ request_headers = {}
86
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
87
+
88
+ # Set Headers
89
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
90
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
91
+
92
+ # Serialize Request
93
+ request_mapper = Azure::Monitor::Mgmt::V2018_06_01_preview::Models::GuestDiagnosticSettingsAssociationResource.mapper()
94
+ request_content = @client.serialize(request_mapper, diagnostic_settings_association)
95
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
96
+
97
+ path_template = '{resourceUri}/providers/microsoft.insights/guestDiagnosticSettingsAssociation/{associationName}'
98
+
99
+ request_url = @base_url || @client.base_url
100
+
101
+ options = {
102
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
103
+ path_params: {'associationName' => association_name},
104
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
105
+ query_params: {'api-version' => @client.api_version},
106
+ body: request_content,
107
+ headers: request_headers.merge(custom_headers || {}),
108
+ base_url: request_url
109
+ }
110
+ promise = @client.make_request_async(:put, path_template, options)
111
+
112
+ promise = promise.then do |result|
113
+ http_response = result.response
114
+ status_code = http_response.status
115
+ response_content = http_response.body
116
+ unless status_code == 200 || status_code == 201
117
+ error_model = JSON.load(response_content)
118
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
119
+ end
120
+
121
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
122
+ # Deserialize Response
123
+ if status_code == 200
124
+ begin
125
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
126
+ result_mapper = Azure::Monitor::Mgmt::V2018_06_01_preview::Models::GuestDiagnosticSettingsAssociationResource.mapper()
127
+ result.body = @client.deserialize(result_mapper, parsed_response)
128
+ rescue Exception => e
129
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
130
+ end
131
+ end
132
+ # Deserialize Response
133
+ if status_code == 201
134
+ begin
135
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
136
+ result_mapper = Azure::Monitor::Mgmt::V2018_06_01_preview::Models::GuestDiagnosticSettingsAssociationResource.mapper()
137
+ result.body = @client.deserialize(result_mapper, parsed_response)
138
+ rescue Exception => e
139
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
140
+ end
141
+ end
142
+
143
+ result
144
+ end
145
+
146
+ promise.execute
147
+ end
148
+
149
+ #
150
+ # Gets guest diagnostics association settings.
151
+ #
152
+ # @param resource_uri [String] The fully qualified ID of the resource,
153
+ # including the resource name and resource type.
154
+ # @param association_name [String] The name of the diagnostic settings
155
+ # association.
156
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
157
+ # will be added to the HTTP request.
158
+ #
159
+ # @return [GuestDiagnosticSettingsAssociationResource] operation results.
160
+ #
161
+ def get(resource_uri, association_name, custom_headers:nil)
162
+ response = get_async(resource_uri, association_name, custom_headers:custom_headers).value!
163
+ response.body unless response.nil?
164
+ end
165
+
166
+ #
167
+ # Gets guest diagnostics association settings.
168
+ #
169
+ # @param resource_uri [String] The fully qualified ID of the resource,
170
+ # including the resource name and resource type.
171
+ # @param association_name [String] The name of the diagnostic settings
172
+ # association.
173
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
174
+ # will be added to the HTTP request.
175
+ #
176
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
177
+ #
178
+ def get_with_http_info(resource_uri, association_name, custom_headers:nil)
179
+ get_async(resource_uri, association_name, custom_headers:custom_headers).value!
180
+ end
181
+
182
+ #
183
+ # Gets guest diagnostics association settings.
184
+ #
185
+ # @param resource_uri [String] The fully qualified ID of the resource,
186
+ # including the resource name and resource type.
187
+ # @param association_name [String] The name of the diagnostic settings
188
+ # association.
189
+ # @param [Hash{String => String}] A hash of custom headers that will be added
190
+ # to the HTTP request.
191
+ #
192
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
193
+ #
194
+ def get_async(resource_uri, association_name, custom_headers:nil)
195
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
196
+ fail ArgumentError, 'association_name is nil' if association_name.nil?
197
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
198
+
199
+
200
+ request_headers = {}
201
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
202
+
203
+ # Set Headers
204
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
205
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
206
+ path_template = '{resourceUri}/providers/microsoft.insights/guestDiagnosticSettingsAssociation/{associationName}'
207
+
208
+ request_url = @base_url || @client.base_url
209
+
210
+ options = {
211
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
212
+ path_params: {'associationName' => association_name},
213
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
214
+ query_params: {'api-version' => @client.api_version},
215
+ headers: request_headers.merge(custom_headers || {}),
216
+ base_url: request_url
217
+ }
218
+ promise = @client.make_request_async(:get, path_template, options)
219
+
220
+ promise = promise.then do |result|
221
+ http_response = result.response
222
+ status_code = http_response.status
223
+ response_content = http_response.body
224
+ unless status_code == 200
225
+ error_model = JSON.load(response_content)
226
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
227
+ end
228
+
229
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
230
+ # Deserialize Response
231
+ if status_code == 200
232
+ begin
233
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
234
+ result_mapper = Azure::Monitor::Mgmt::V2018_06_01_preview::Models::GuestDiagnosticSettingsAssociationResource.mapper()
235
+ result.body = @client.deserialize(result_mapper, parsed_response)
236
+ rescue Exception => e
237
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
238
+ end
239
+ end
240
+
241
+ result
242
+ end
243
+
244
+ promise.execute
245
+ end
246
+
247
+ #
248
+ # Delete guest diagnostics association settings.
249
+ #
250
+ # @param resource_uri [String] The fully qualified ID of the resource,
251
+ # including the resource name and resource type.
252
+ # @param association_name [String] The name of the diagnostic settings
253
+ # association.
254
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
255
+ # will be added to the HTTP request.
256
+ #
257
+ #
258
+ def delete(resource_uri, association_name, custom_headers:nil)
259
+ response = delete_async(resource_uri, association_name, custom_headers:custom_headers).value!
260
+ nil
261
+ end
262
+
263
+ #
264
+ # Delete guest diagnostics association settings.
265
+ #
266
+ # @param resource_uri [String] The fully qualified ID of the resource,
267
+ # including the resource name and resource type.
268
+ # @param association_name [String] The name of the diagnostic settings
269
+ # association.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
274
+ #
275
+ def delete_with_http_info(resource_uri, association_name, custom_headers:nil)
276
+ delete_async(resource_uri, association_name, custom_headers:custom_headers).value!
277
+ end
278
+
279
+ #
280
+ # Delete guest diagnostics association settings.
281
+ #
282
+ # @param resource_uri [String] The fully qualified ID of the resource,
283
+ # including the resource name and resource type.
284
+ # @param association_name [String] The name of the diagnostic settings
285
+ # association.
286
+ # @param [Hash{String => String}] A hash of custom headers that will be added
287
+ # to the HTTP request.
288
+ #
289
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
290
+ #
291
+ def delete_async(resource_uri, association_name, custom_headers:nil)
292
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
293
+ fail ArgumentError, 'association_name is nil' if association_name.nil?
294
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
295
+
296
+
297
+ request_headers = {}
298
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
299
+
300
+ # Set Headers
301
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
302
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
303
+ path_template = '{resourceUri}/providers/microsoft.insights/guestDiagnosticSettingsAssociation/{associationName}'
304
+
305
+ request_url = @base_url || @client.base_url
306
+
307
+ options = {
308
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
309
+ path_params: {'associationName' => association_name},
310
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
311
+ query_params: {'api-version' => @client.api_version},
312
+ headers: request_headers.merge(custom_headers || {}),
313
+ base_url: request_url
314
+ }
315
+ promise = @client.make_request_async(:delete, path_template, options)
316
+
317
+ promise = promise.then do |result|
318
+ http_response = result.response
319
+ status_code = http_response.status
320
+ response_content = http_response.body
321
+ unless status_code == 200 || status_code == 204
322
+ error_model = JSON.load(response_content)
323
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
324
+ end
325
+
326
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
327
+
328
+ result
329
+ end
330
+
331
+ promise.execute
332
+ end
333
+
334
+ #
335
+ # Updates an existing guestDiagnosticsSettingsAssociation Resource. To update
336
+ # other fields use the CreateOrUpdate method
337
+ #
338
+ # @param resource_uri [String] The fully qualified ID of the resource,
339
+ # including the resource name and resource type.
340
+ # @param association_name [String] The name of the diagnostic settings
341
+ # association.
342
+ # @param parameters [GuestDiagnosticSettingsAssociationResourcePatch]
343
+ # Parameters supplied to the operation.
344
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
345
+ # will be added to the HTTP request.
346
+ #
347
+ # @return [GuestDiagnosticSettingsAssociationResource] operation results.
348
+ #
349
+ def update(resource_uri, association_name, parameters, custom_headers:nil)
350
+ response = update_async(resource_uri, association_name, parameters, custom_headers:custom_headers).value!
351
+ response.body unless response.nil?
352
+ end
353
+
354
+ #
355
+ # Updates an existing guestDiagnosticsSettingsAssociation Resource. To update
356
+ # other fields use the CreateOrUpdate method
357
+ #
358
+ # @param resource_uri [String] The fully qualified ID of the resource,
359
+ # including the resource name and resource type.
360
+ # @param association_name [String] The name of the diagnostic settings
361
+ # association.
362
+ # @param parameters [GuestDiagnosticSettingsAssociationResourcePatch]
363
+ # Parameters supplied to the operation.
364
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
365
+ # will be added to the HTTP request.
366
+ #
367
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
368
+ #
369
+ def update_with_http_info(resource_uri, association_name, parameters, custom_headers:nil)
370
+ update_async(resource_uri, association_name, parameters, custom_headers:custom_headers).value!
371
+ end
372
+
373
+ #
374
+ # Updates an existing guestDiagnosticsSettingsAssociation Resource. To update
375
+ # other fields use the CreateOrUpdate method
376
+ #
377
+ # @param resource_uri [String] The fully qualified ID of the resource,
378
+ # including the resource name and resource type.
379
+ # @param association_name [String] The name of the diagnostic settings
380
+ # association.
381
+ # @param parameters [GuestDiagnosticSettingsAssociationResourcePatch]
382
+ # Parameters supplied to the operation.
383
+ # @param [Hash{String => String}] A hash of custom headers that will be added
384
+ # to the HTTP request.
385
+ #
386
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
387
+ #
388
+ def update_async(resource_uri, association_name, parameters, custom_headers:nil)
389
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
390
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
391
+ fail ArgumentError, 'association_name is nil' if association_name.nil?
392
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
393
+
394
+
395
+ request_headers = {}
396
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
397
+
398
+ # Set Headers
399
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
400
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
401
+
402
+ # Serialize Request
403
+ request_mapper = Azure::Monitor::Mgmt::V2018_06_01_preview::Models::GuestDiagnosticSettingsAssociationResourcePatch.mapper()
404
+ request_content = @client.serialize(request_mapper, parameters)
405
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
406
+
407
+ path_template = '{resourceUri}/providers/microsoft.insights/guestDiagnosticSettingsAssociation/{associationName}'
408
+
409
+ request_url = @base_url || @client.base_url
410
+
411
+ options = {
412
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
413
+ path_params: {'associationName' => association_name},
414
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
415
+ query_params: {'api-version' => @client.api_version},
416
+ body: request_content,
417
+ headers: request_headers.merge(custom_headers || {}),
418
+ base_url: request_url
419
+ }
420
+ promise = @client.make_request_async(:patch, path_template, options)
421
+
422
+ promise = promise.then do |result|
423
+ http_response = result.response
424
+ status_code = http_response.status
425
+ response_content = http_response.body
426
+ unless status_code == 200
427
+ error_model = JSON.load(response_content)
428
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
429
+ end
430
+
431
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
432
+ # Deserialize Response
433
+ if status_code == 200
434
+ begin
435
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
436
+ result_mapper = Azure::Monitor::Mgmt::V2018_06_01_preview::Models::GuestDiagnosticSettingsAssociationResource.mapper()
437
+ result.body = @client.deserialize(result_mapper, parsed_response)
438
+ rescue Exception => e
439
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
440
+ end
441
+ end
442
+
443
+ result
444
+ end
445
+
446
+ promise.execute
447
+ end
448
+
449
+ #
450
+ # Get a list of all guest diagnostic settings association in a subscription.
451
+ #
452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
453
+ # will be added to the HTTP request.
454
+ #
455
+ # @return [GuestDiagnosticSettingsAssociationList] operation results.
456
+ #
457
+ def list(custom_headers:nil)
458
+ response = list_async(custom_headers:custom_headers).value!
459
+ response.body unless response.nil?
460
+ end
461
+
462
+ #
463
+ # Get a list of all guest diagnostic settings association in a subscription.
464
+ #
465
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
466
+ # will be added to the HTTP request.
467
+ #
468
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
469
+ #
470
+ def list_with_http_info(custom_headers:nil)
471
+ list_async(custom_headers:custom_headers).value!
472
+ end
473
+
474
+ #
475
+ # Get a list of all guest diagnostic settings association in a subscription.
476
+ #
477
+ # @param [Hash{String => String}] A hash of custom headers that will be added
478
+ # to the HTTP request.
479
+ #
480
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
481
+ #
482
+ def list_async(custom_headers:nil)
483
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
484
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
485
+
486
+
487
+ request_headers = {}
488
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
489
+
490
+ # Set Headers
491
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
492
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
493
+ path_template = 'subscriptions/{subscriptionId}/providers/microsoft.insights/guestDiagnosticSettingsAssociations'
494
+
495
+ request_url = @base_url || @client.base_url
496
+
497
+ options = {
498
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
499
+ path_params: {'subscriptionId' => @client.subscription_id},
500
+ query_params: {'api-version' => @client.api_version},
501
+ headers: request_headers.merge(custom_headers || {}),
502
+ base_url: request_url
503
+ }
504
+ promise = @client.make_request_async(:get, path_template, options)
505
+
506
+ promise = promise.then do |result|
507
+ http_response = result.response
508
+ status_code = http_response.status
509
+ response_content = http_response.body
510
+ unless status_code == 200
511
+ error_model = JSON.load(response_content)
512
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
513
+ end
514
+
515
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
516
+ # Deserialize Response
517
+ if status_code == 200
518
+ begin
519
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
520
+ result_mapper = Azure::Monitor::Mgmt::V2018_06_01_preview::Models::GuestDiagnosticSettingsAssociationList.mapper()
521
+ result.body = @client.deserialize(result_mapper, parsed_response)
522
+ rescue Exception => e
523
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
524
+ end
525
+ end
526
+
527
+ result
528
+ end
529
+
530
+ promise.execute
531
+ end
532
+
533
+ #
534
+ # Get a list of all guest diagnostic settings association in a resource group.
535
+ #
536
+ # @param resource_group_name [String] The name of the resource group.
537
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
538
+ # will be added to the HTTP request.
539
+ #
540
+ # @return [GuestDiagnosticSettingsAssociationList] operation results.
541
+ #
542
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
543
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
544
+ response.body unless response.nil?
545
+ end
546
+
547
+ #
548
+ # Get a list of all guest diagnostic settings association in a resource group.
549
+ #
550
+ # @param resource_group_name [String] The name of the resource group.
551
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
552
+ # will be added to the HTTP request.
553
+ #
554
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
555
+ #
556
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
557
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
558
+ end
559
+
560
+ #
561
+ # Get a list of all guest diagnostic settings association in a resource group.
562
+ #
563
+ # @param resource_group_name [String] The name of the resource group.
564
+ # @param [Hash{String => String}] A hash of custom headers that will be added
565
+ # to the HTTP request.
566
+ #
567
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
568
+ #
569
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
570
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
571
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
572
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
573
+
574
+
575
+ request_headers = {}
576
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
577
+
578
+ # Set Headers
579
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
580
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
581
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettingsAssociations'
582
+
583
+ request_url = @base_url || @client.base_url
584
+
585
+ options = {
586
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
587
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
588
+ query_params: {'api-version' => @client.api_version},
589
+ headers: request_headers.merge(custom_headers || {}),
590
+ base_url: request_url
591
+ }
592
+ promise = @client.make_request_async(:get, path_template, options)
593
+
594
+ promise = promise.then do |result|
595
+ http_response = result.response
596
+ status_code = http_response.status
597
+ response_content = http_response.body
598
+ unless status_code == 200
599
+ error_model = JSON.load(response_content)
600
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
601
+ end
602
+
603
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
604
+ # Deserialize Response
605
+ if status_code == 200
606
+ begin
607
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
608
+ result_mapper = Azure::Monitor::Mgmt::V2018_06_01_preview::Models::GuestDiagnosticSettingsAssociationList.mapper()
609
+ result.body = @client.deserialize(result_mapper, parsed_response)
610
+ rescue Exception => e
611
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
612
+ end
613
+ end
614
+
615
+ result
616
+ end
617
+
618
+ promise.execute
619
+ end
620
+
621
+ end
622
+ end