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,290 @@
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_09_01
7
+ #
8
+ # MetricBaseline
9
+ #
10
+ class MetricBaseline
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the MetricBaseline 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
+ # **Gets the baseline values for a specific metric**.
26
+ #
27
+ # @param resource_uri [String] The identifier of the resource. It has the
28
+ # following structure:
29
+ # subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
30
+ # For example:
31
+ # subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
32
+ # @param metric_name [String] The name of the metric to retrieve the baseline
33
+ # for.
34
+ # @param timespan [String] The timespan of the query. It is a string with the
35
+ # following format 'startDateTime_ISO/endDateTime_ISO'.
36
+ # @param interval [Duration] The interval (i.e. timegrain) of the query.
37
+ # @param aggregation [String] The aggregation type of the metric to retrieve
38
+ # the baseline for.
39
+ # @param sensitivities [String] The list of sensitivities (comma separated) to
40
+ # retrieve.
41
+ # @param result_type [ResultType] Allows retrieving only metadata of the
42
+ # baseline. On data request all information is retrieved. Possible values
43
+ # include: 'Data', 'Metadata'
44
+ # @param metricnamespace [String] Metric namespace to query metric definitions
45
+ # for.
46
+ # @param filter [String] The **$filter** is used to describe a set of
47
+ # dimensions with their concrete values which produce a specific metric�s time
48
+ # series, in which a baseline is requested for.
49
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
50
+ # will be added to the HTTP request.
51
+ #
52
+ # @return [BaselineResponse] operation results.
53
+ #
54
+ def get(resource_uri, metric_name, timespan:nil, interval:nil, aggregation:nil, sensitivities:nil, result_type:nil, metricnamespace:nil, filter:nil, custom_headers:nil)
55
+ response = get_async(resource_uri, metric_name, timespan:timespan, interval:interval, aggregation:aggregation, sensitivities:sensitivities, result_type:result_type, metricnamespace:metricnamespace, filter:filter, custom_headers:custom_headers).value!
56
+ response.body unless response.nil?
57
+ end
58
+
59
+ #
60
+ # **Gets the baseline values for a specific metric**.
61
+ #
62
+ # @param resource_uri [String] The identifier of the resource. It has the
63
+ # following structure:
64
+ # subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
65
+ # For example:
66
+ # subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
67
+ # @param metric_name [String] The name of the metric to retrieve the baseline
68
+ # for.
69
+ # @param timespan [String] The timespan of the query. It is a string with the
70
+ # following format 'startDateTime_ISO/endDateTime_ISO'.
71
+ # @param interval [Duration] The interval (i.e. timegrain) of the query.
72
+ # @param aggregation [String] The aggregation type of the metric to retrieve
73
+ # the baseline for.
74
+ # @param sensitivities [String] The list of sensitivities (comma separated) to
75
+ # retrieve.
76
+ # @param result_type [ResultType] Allows retrieving only metadata of the
77
+ # baseline. On data request all information is retrieved. Possible values
78
+ # include: 'Data', 'Metadata'
79
+ # @param metricnamespace [String] Metric namespace to query metric definitions
80
+ # for.
81
+ # @param filter [String] The **$filter** is used to describe a set of
82
+ # dimensions with their concrete values which produce a specific metric�s time
83
+ # series, in which a baseline is requested for.
84
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
85
+ # will be added to the HTTP request.
86
+ #
87
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
88
+ #
89
+ def get_with_http_info(resource_uri, metric_name, timespan:nil, interval:nil, aggregation:nil, sensitivities:nil, result_type:nil, metricnamespace:nil, filter:nil, custom_headers:nil)
90
+ get_async(resource_uri, metric_name, timespan:timespan, interval:interval, aggregation:aggregation, sensitivities:sensitivities, result_type:result_type, metricnamespace:metricnamespace, filter:filter, custom_headers:custom_headers).value!
91
+ end
92
+
93
+ #
94
+ # **Gets the baseline values for a specific metric**.
95
+ #
96
+ # @param resource_uri [String] The identifier of the resource. It has the
97
+ # following structure:
98
+ # subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
99
+ # For example:
100
+ # subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
101
+ # @param metric_name [String] The name of the metric to retrieve the baseline
102
+ # for.
103
+ # @param timespan [String] The timespan of the query. It is a string with the
104
+ # following format 'startDateTime_ISO/endDateTime_ISO'.
105
+ # @param interval [Duration] The interval (i.e. timegrain) of the query.
106
+ # @param aggregation [String] The aggregation type of the metric to retrieve
107
+ # the baseline for.
108
+ # @param sensitivities [String] The list of sensitivities (comma separated) to
109
+ # retrieve.
110
+ # @param result_type [ResultType] Allows retrieving only metadata of the
111
+ # baseline. On data request all information is retrieved. Possible values
112
+ # include: 'Data', 'Metadata'
113
+ # @param metricnamespace [String] Metric namespace to query metric definitions
114
+ # for.
115
+ # @param filter [String] The **$filter** is used to describe a set of
116
+ # dimensions with their concrete values which produce a specific metric�s time
117
+ # series, in which a baseline is requested for.
118
+ # @param [Hash{String => String}] A hash of custom headers that will be added
119
+ # to the HTTP request.
120
+ #
121
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
122
+ #
123
+ def get_async(resource_uri, metric_name, timespan:nil, interval:nil, aggregation:nil, sensitivities:nil, result_type:nil, metricnamespace:nil, filter:nil, custom_headers:nil)
124
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
125
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
126
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
127
+
128
+
129
+ request_headers = {}
130
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
131
+
132
+ # Set Headers
133
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
134
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
135
+ path_template = '{resourceUri}/providers/microsoft.insights/baseline/{metricName}'
136
+
137
+ request_url = @base_url || @client.base_url
138
+
139
+ options = {
140
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
141
+ path_params: {'metricName' => metric_name},
142
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
143
+ query_params: {'timespan' => timespan,'interval' => interval,'aggregation' => aggregation,'sensitivities' => sensitivities,'resultType' => result_type,'api-version' => @client.api_version,'metricnamespace' => metricnamespace,'$filter' => filter},
144
+ headers: request_headers.merge(custom_headers || {}),
145
+ base_url: request_url
146
+ }
147
+ promise = @client.make_request_async(:get, path_template, options)
148
+
149
+ promise = promise.then do |result|
150
+ http_response = result.response
151
+ status_code = http_response.status
152
+ response_content = http_response.body
153
+ unless status_code == 200
154
+ error_model = JSON.load(response_content)
155
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
156
+ end
157
+
158
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
159
+ # Deserialize Response
160
+ if status_code == 200
161
+ begin
162
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
163
+ result_mapper = Azure::Monitor::Mgmt::V2018_09_01::Models::BaselineResponse.mapper()
164
+ result.body = @client.deserialize(result_mapper, parsed_response)
165
+ rescue Exception => e
166
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
167
+ end
168
+ end
169
+
170
+ result
171
+ end
172
+
173
+ promise.execute
174
+ end
175
+
176
+ #
177
+ # **Lists the baseline values for a resource**.
178
+ #
179
+ # @param resource_uri [String] The identifier of the resource. It has the
180
+ # following structure:
181
+ # subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
182
+ # For example:
183
+ # subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
184
+ # @param time_series_information [TimeSeriesInformation] Information that need
185
+ # to be specified to calculate a baseline on a time series.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ # @return [CalculateBaselineResponse] operation results.
190
+ #
191
+ def calculate_baseline(resource_uri, time_series_information, custom_headers:nil)
192
+ response = calculate_baseline_async(resource_uri, time_series_information, custom_headers:custom_headers).value!
193
+ response.body unless response.nil?
194
+ end
195
+
196
+ #
197
+ # **Lists the baseline values for a resource**.
198
+ #
199
+ # @param resource_uri [String] The identifier of the resource. It has the
200
+ # following structure:
201
+ # subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
202
+ # For example:
203
+ # subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
204
+ # @param time_series_information [TimeSeriesInformation] Information that need
205
+ # to be specified to calculate a baseline on a time series.
206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
207
+ # will be added to the HTTP request.
208
+ #
209
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
210
+ #
211
+ def calculate_baseline_with_http_info(resource_uri, time_series_information, custom_headers:nil)
212
+ calculate_baseline_async(resource_uri, time_series_information, custom_headers:custom_headers).value!
213
+ end
214
+
215
+ #
216
+ # **Lists the baseline values for a resource**.
217
+ #
218
+ # @param resource_uri [String] The identifier of the resource. It has the
219
+ # following structure:
220
+ # subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
221
+ # For example:
222
+ # subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
223
+ # @param time_series_information [TimeSeriesInformation] Information that need
224
+ # to be specified to calculate a baseline on a time series.
225
+ # @param [Hash{String => String}] A hash of custom headers that will be added
226
+ # to the HTTP request.
227
+ #
228
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
229
+ #
230
+ def calculate_baseline_async(resource_uri, time_series_information, custom_headers:nil)
231
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
232
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
233
+ fail ArgumentError, 'time_series_information is nil' if time_series_information.nil?
234
+
235
+
236
+ request_headers = {}
237
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
238
+
239
+ # Set Headers
240
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
241
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
242
+
243
+ # Serialize Request
244
+ request_mapper = Azure::Monitor::Mgmt::V2018_09_01::Models::TimeSeriesInformation.mapper()
245
+ request_content = @client.serialize(request_mapper, time_series_information)
246
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
247
+
248
+ path_template = '{resourceUri}/providers/microsoft.insights/calculatebaseline'
249
+
250
+ request_url = @base_url || @client.base_url
251
+
252
+ options = {
253
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
254
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
255
+ query_params: {'api-version' => @client.api_version},
256
+ body: request_content,
257
+ headers: request_headers.merge(custom_headers || {}),
258
+ base_url: request_url
259
+ }
260
+ promise = @client.make_request_async(:post, path_template, options)
261
+
262
+ promise = promise.then do |result|
263
+ http_response = result.response
264
+ status_code = http_response.status
265
+ response_content = http_response.body
266
+ unless status_code == 200
267
+ error_model = JSON.load(response_content)
268
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
269
+ end
270
+
271
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
272
+ # Deserialize Response
273
+ if status_code == 200
274
+ begin
275
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
276
+ result_mapper = Azure::Monitor::Mgmt::V2018_09_01::Models::CalculateBaselineResponse.mapper()
277
+ result.body = @client.deserialize(result_mapper, parsed_response)
278
+ rescue Exception => e
279
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
280
+ end
281
+ end
282
+
283
+ result
284
+ end
285
+
286
+ promise.execute
287
+ end
288
+
289
+ end
290
+ end
@@ -0,0 +1,67 @@
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_09_01
7
+ module Models
8
+ #
9
+ # A list of action groups.
10
+ #
11
+ class ActionGroupList
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<ActionGroupResource>] The list of action groups.
16
+ attr_accessor :value
17
+
18
+ # @return [String] Provides the link to retrieve the next set of
19
+ # elements.
20
+ attr_accessor :next_link
21
+
22
+
23
+ #
24
+ # Mapper for ActionGroupList class as Ruby Hash.
25
+ # This will be used for serialization/deserialization.
26
+ #
27
+ def self.mapper()
28
+ {
29
+ client_side_validation: true,
30
+ required: false,
31
+ serialized_name: 'ActionGroupList',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'ActionGroupList',
35
+ model_properties: {
36
+ value: {
37
+ client_side_validation: true,
38
+ required: false,
39
+ serialized_name: 'value',
40
+ type: {
41
+ name: 'Sequence',
42
+ element: {
43
+ client_side_validation: true,
44
+ required: false,
45
+ serialized_name: 'ActionGroupResourceElementType',
46
+ type: {
47
+ name: 'Composite',
48
+ class_name: 'ActionGroupResource'
49
+ }
50
+ }
51
+ }
52
+ },
53
+ next_link: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ serialized_name: 'nextLink',
57
+ type: {
58
+ name: 'String'
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,68 @@
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_09_01
7
+ module Models
8
+ #
9
+ # An action group object for the body of patch operations.
10
+ #
11
+ class ActionGroupPatchBody
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Hash{String => String}] Resource tags
16
+ attr_accessor :tags
17
+
18
+ # @return [Boolean] Indicates whether this action group is enabled. If an
19
+ # action group is not enabled, then none of its actions will be
20
+ # activated. Default value: true .
21
+ attr_accessor :enabled
22
+
23
+
24
+ #
25
+ # Mapper for ActionGroupPatchBody class as Ruby Hash.
26
+ # This will be used for serialization/deserialization.
27
+ #
28
+ def self.mapper()
29
+ {
30
+ client_side_validation: true,
31
+ required: false,
32
+ serialized_name: 'ActionGroupPatchBody',
33
+ type: {
34
+ name: 'Composite',
35
+ class_name: 'ActionGroupPatchBody',
36
+ model_properties: {
37
+ tags: {
38
+ client_side_validation: true,
39
+ required: false,
40
+ serialized_name: 'tags',
41
+ type: {
42
+ name: 'Dictionary',
43
+ value: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: 'StringElementType',
47
+ type: {
48
+ name: 'String'
49
+ }
50
+ }
51
+ }
52
+ },
53
+ enabled: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ serialized_name: 'properties.enabled',
57
+ default_value: true,
58
+ type: {
59
+ name: 'Boolean'
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,326 @@
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_09_01
7
+ module Models
8
+ #
9
+ # An action group resource.
10
+ #
11
+ class ActionGroupResource < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The short name of the action group. This will be used
16
+ # in SMS messages.
17
+ attr_accessor :group_short_name
18
+
19
+ # @return [Boolean] Indicates whether this action group is enabled. If an
20
+ # action group is not enabled, then none of its receivers will receive
21
+ # communications. Default value: true .
22
+ attr_accessor :enabled
23
+
24
+ # @return [Array<EmailReceiver>] The list of email receivers that are
25
+ # part of this action group.
26
+ attr_accessor :email_receivers
27
+
28
+ # @return [Array<SmsReceiver>] The list of SMS receivers that are part of
29
+ # this action group.
30
+ attr_accessor :sms_receivers
31
+
32
+ # @return [Array<WebhookReceiver>] The list of webhook receivers that are
33
+ # part of this action group.
34
+ attr_accessor :webhook_receivers
35
+
36
+ # @return [Array<ItsmReceiver>] The list of ITSM receivers that are part
37
+ # of this action group.
38
+ attr_accessor :itsm_receivers
39
+
40
+ # @return [Array<AzureAppPushReceiver>] The list of AzureAppPush
41
+ # receivers that are part of this action group.
42
+ attr_accessor :azure_app_push_receivers
43
+
44
+ # @return [Array<AutomationRunbookReceiver>] The list of
45
+ # AutomationRunbook receivers that are part of this action group.
46
+ attr_accessor :automation_runbook_receivers
47
+
48
+ # @return [Array<VoiceReceiver>] The list of voice receivers that are
49
+ # part of this action group.
50
+ attr_accessor :voice_receivers
51
+
52
+ # @return [Array<LogicAppReceiver>] The list of logic app receivers that
53
+ # are part of this action group.
54
+ attr_accessor :logic_app_receivers
55
+
56
+ # @return [Array<AzureFunctionReceiver>] The list of azure function
57
+ # receivers that are part of this action group.
58
+ attr_accessor :azure_function_receivers
59
+
60
+ # @return [Array<ArmRoleReceiver>] The list of ARM role receivers that
61
+ # are part of this action group. Roles are Azure RBAC roles and only
62
+ # built-in roles are supported.
63
+ attr_accessor :arm_role_receivers
64
+
65
+
66
+ #
67
+ # Mapper for ActionGroupResource class as Ruby Hash.
68
+ # This will be used for serialization/deserialization.
69
+ #
70
+ def self.mapper()
71
+ {
72
+ client_side_validation: true,
73
+ required: false,
74
+ serialized_name: 'ActionGroupResource',
75
+ type: {
76
+ name: 'Composite',
77
+ class_name: 'ActionGroupResource',
78
+ model_properties: {
79
+ id: {
80
+ client_side_validation: true,
81
+ required: false,
82
+ read_only: true,
83
+ serialized_name: 'id',
84
+ type: {
85
+ name: 'String'
86
+ }
87
+ },
88
+ name: {
89
+ client_side_validation: true,
90
+ required: false,
91
+ read_only: true,
92
+ serialized_name: 'name',
93
+ type: {
94
+ name: 'String'
95
+ }
96
+ },
97
+ type: {
98
+ client_side_validation: true,
99
+ required: false,
100
+ read_only: true,
101
+ serialized_name: 'type',
102
+ type: {
103
+ name: 'String'
104
+ }
105
+ },
106
+ location: {
107
+ client_side_validation: true,
108
+ required: true,
109
+ serialized_name: 'location',
110
+ type: {
111
+ name: 'String'
112
+ }
113
+ },
114
+ tags: {
115
+ client_side_validation: true,
116
+ required: false,
117
+ serialized_name: 'tags',
118
+ type: {
119
+ name: 'Dictionary',
120
+ value: {
121
+ client_side_validation: true,
122
+ required: false,
123
+ serialized_name: 'StringElementType',
124
+ type: {
125
+ name: 'String'
126
+ }
127
+ }
128
+ }
129
+ },
130
+ group_short_name: {
131
+ client_side_validation: true,
132
+ required: true,
133
+ serialized_name: 'properties.groupShortName',
134
+ constraints: {
135
+ MaxLength: 12
136
+ },
137
+ type: {
138
+ name: 'String'
139
+ }
140
+ },
141
+ enabled: {
142
+ client_side_validation: true,
143
+ required: true,
144
+ serialized_name: 'properties.enabled',
145
+ default_value: true,
146
+ type: {
147
+ name: 'Boolean'
148
+ }
149
+ },
150
+ email_receivers: {
151
+ client_side_validation: true,
152
+ required: false,
153
+ serialized_name: 'properties.emailReceivers',
154
+ type: {
155
+ name: 'Sequence',
156
+ element: {
157
+ client_side_validation: true,
158
+ required: false,
159
+ serialized_name: 'EmailReceiverElementType',
160
+ type: {
161
+ name: 'Composite',
162
+ class_name: 'EmailReceiver'
163
+ }
164
+ }
165
+ }
166
+ },
167
+ sms_receivers: {
168
+ client_side_validation: true,
169
+ required: false,
170
+ serialized_name: 'properties.smsReceivers',
171
+ type: {
172
+ name: 'Sequence',
173
+ element: {
174
+ client_side_validation: true,
175
+ required: false,
176
+ serialized_name: 'SmsReceiverElementType',
177
+ type: {
178
+ name: 'Composite',
179
+ class_name: 'SmsReceiver'
180
+ }
181
+ }
182
+ }
183
+ },
184
+ webhook_receivers: {
185
+ client_side_validation: true,
186
+ required: false,
187
+ serialized_name: 'properties.webhookReceivers',
188
+ type: {
189
+ name: 'Sequence',
190
+ element: {
191
+ client_side_validation: true,
192
+ required: false,
193
+ serialized_name: 'WebhookReceiverElementType',
194
+ type: {
195
+ name: 'Composite',
196
+ class_name: 'WebhookReceiver'
197
+ }
198
+ }
199
+ }
200
+ },
201
+ itsm_receivers: {
202
+ client_side_validation: true,
203
+ required: false,
204
+ serialized_name: 'properties.itsmReceivers',
205
+ type: {
206
+ name: 'Sequence',
207
+ element: {
208
+ client_side_validation: true,
209
+ required: false,
210
+ serialized_name: 'ItsmReceiverElementType',
211
+ type: {
212
+ name: 'Composite',
213
+ class_name: 'ItsmReceiver'
214
+ }
215
+ }
216
+ }
217
+ },
218
+ azure_app_push_receivers: {
219
+ client_side_validation: true,
220
+ required: false,
221
+ serialized_name: 'properties.azureAppPushReceivers',
222
+ type: {
223
+ name: 'Sequence',
224
+ element: {
225
+ client_side_validation: true,
226
+ required: false,
227
+ serialized_name: 'AzureAppPushReceiverElementType',
228
+ type: {
229
+ name: 'Composite',
230
+ class_name: 'AzureAppPushReceiver'
231
+ }
232
+ }
233
+ }
234
+ },
235
+ automation_runbook_receivers: {
236
+ client_side_validation: true,
237
+ required: false,
238
+ serialized_name: 'properties.automationRunbookReceivers',
239
+ type: {
240
+ name: 'Sequence',
241
+ element: {
242
+ client_side_validation: true,
243
+ required: false,
244
+ serialized_name: 'AutomationRunbookReceiverElementType',
245
+ type: {
246
+ name: 'Composite',
247
+ class_name: 'AutomationRunbookReceiver'
248
+ }
249
+ }
250
+ }
251
+ },
252
+ voice_receivers: {
253
+ client_side_validation: true,
254
+ required: false,
255
+ serialized_name: 'properties.voiceReceivers',
256
+ type: {
257
+ name: 'Sequence',
258
+ element: {
259
+ client_side_validation: true,
260
+ required: false,
261
+ serialized_name: 'VoiceReceiverElementType',
262
+ type: {
263
+ name: 'Composite',
264
+ class_name: 'VoiceReceiver'
265
+ }
266
+ }
267
+ }
268
+ },
269
+ logic_app_receivers: {
270
+ client_side_validation: true,
271
+ required: false,
272
+ serialized_name: 'properties.logicAppReceivers',
273
+ type: {
274
+ name: 'Sequence',
275
+ element: {
276
+ client_side_validation: true,
277
+ required: false,
278
+ serialized_name: 'LogicAppReceiverElementType',
279
+ type: {
280
+ name: 'Composite',
281
+ class_name: 'LogicAppReceiver'
282
+ }
283
+ }
284
+ }
285
+ },
286
+ azure_function_receivers: {
287
+ client_side_validation: true,
288
+ required: false,
289
+ serialized_name: 'properties.azureFunctionReceivers',
290
+ type: {
291
+ name: 'Sequence',
292
+ element: {
293
+ client_side_validation: true,
294
+ required: false,
295
+ serialized_name: 'AzureFunctionReceiverElementType',
296
+ type: {
297
+ name: 'Composite',
298
+ class_name: 'AzureFunctionReceiver'
299
+ }
300
+ }
301
+ }
302
+ },
303
+ arm_role_receivers: {
304
+ client_side_validation: true,
305
+ required: false,
306
+ serialized_name: 'properties.armRoleReceivers',
307
+ type: {
308
+ name: 'Sequence',
309
+ element: {
310
+ client_side_validation: true,
311
+ required: false,
312
+ serialized_name: 'ArmRoleReceiverElementType',
313
+ type: {
314
+ name: 'Composite',
315
+ class_name: 'ArmRoleReceiver'
316
+ }
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ }
323
+ end
324
+ end
325
+ end
326
+ end