azure_mgmt_monitor 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-04-01/generated/azure_mgmt_monitor.rb +14 -4
  3. data/lib/2015-04-01/generated/azure_mgmt_monitor/activity_logs.rb +313 -0
  4. data/lib/2015-04-01/generated/azure_mgmt_monitor/autoscale_settings.rb +1 -1
  5. data/lib/2015-04-01/generated/azure_mgmt_monitor/event_categories.rb +113 -0
  6. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/event_category_collection.rb +57 -0
  7. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/event_data.rb +380 -0
  8. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/event_data_collection.rb +99 -0
  9. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/event_level.rb +19 -0
  10. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/http_request_info.rb +79 -0
  11. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/localizable_string.rb +57 -0
  12. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/sender_authorization.rb +71 -0
  13. data/lib/2015-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +12 -0
  14. data/lib/2015-04-01/generated/azure_mgmt_monitor/operations.rb +1 -1
  15. data/lib/2015-04-01/generated/azure_mgmt_monitor/tenant_activity_logs.rb +339 -0
  16. data/lib/2016-03-01/generated/azure_mgmt_monitor.rb +17 -10
  17. data/lib/2016-03-01/generated/azure_mgmt_monitor/alert_rule_incidents.rb +1 -1
  18. data/lib/2016-03-01/generated/azure_mgmt_monitor/alert_rules.rb +1 -1
  19. data/lib/2016-03-01/generated/azure_mgmt_monitor/log_profiles.rb +1 -1
  20. data/lib/2016-03-01/generated/azure_mgmt_monitor/metric_definitions.rb +133 -0
  21. data/lib/2016-03-01/generated/azure_mgmt_monitor/models/aggregation_type.rb +20 -0
  22. data/lib/2016-03-01/generated/azure_mgmt_monitor/models/localizable_string.rb +57 -0
  23. data/lib/2016-03-01/generated/azure_mgmt_monitor/models/metric_availability.rb +60 -0
  24. data/lib/2016-03-01/generated/azure_mgmt_monitor/models/metric_definition.rb +120 -0
  25. data/lib/2016-03-01/generated/azure_mgmt_monitor/models/metric_definition_collection.rb +56 -0
  26. data/lib/2016-03-01/generated/azure_mgmt_monitor/models/unit.rb +21 -0
  27. data/lib/2016-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +8 -4
  28. data/lib/2016-09-01/generated/azure_mgmt_monitor.rb +9 -3
  29. data/lib/2016-09-01/generated/azure_mgmt_monitor/metrics.rb +172 -0
  30. data/lib/2016-09-01/generated/azure_mgmt_monitor/models/localizable_string.rb +57 -0
  31. data/lib/2016-09-01/generated/azure_mgmt_monitor/models/metric.rb +105 -0
  32. data/lib/2016-09-01/generated/azure_mgmt_monitor/models/metric_collection.rb +55 -0
  33. data/lib/2016-09-01/generated/azure_mgmt_monitor/models/metric_value.rb +104 -0
  34. data/lib/2016-09-01/generated/azure_mgmt_monitor/models/unit.rb +21 -0
  35. data/lib/2016-09-01/generated/azure_mgmt_monitor/monitor_client.rb +4 -0
  36. data/lib/2016-09-01/generated/azure_mgmt_monitor/service_diagnostic_settings_operations.rb +4 -4
  37. data/lib/2017-04-01/generated/azure_mgmt_monitor/action_groups.rb +1 -1
  38. data/lib/2017-04-01/generated/azure_mgmt_monitor/activity_log_alerts.rb +1 -1
  39. data/lib/2017-04-01/generated/azure_mgmt_monitor/models/action_group_resource.rb +1 -1
  40. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor.rb +19 -5
  41. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/diagnostic_settings_category_operations.rb +4 -3
  42. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/diagnostic_settings_operations.rb +8 -5
  43. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/metric_definitions.rb +112 -0
  44. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/metrics.rb +190 -0
  45. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/aggregation_type.rb +20 -0
  46. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/localizable_string.rb +57 -0
  47. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/metadata_value.rb +58 -0
  48. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/metric.rb +105 -0
  49. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/metric_availability.rb +60 -0
  50. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/metric_definition.rb +152 -0
  51. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/metric_definition_collection.rb +56 -0
  52. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/metric_value.rb +104 -0
  53. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/response.rb +98 -0
  54. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/result_type.rb +16 -0
  55. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/time_series_element.rb +79 -0
  56. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/unit.rb +23 -0
  57. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +11 -3
  58. data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/metric_baseline.rb +1 -1
  59. data/lib/2018-01-01/generated/azure_mgmt_monitor.rb +42 -0
  60. data/lib/2018-01-01/generated/azure_mgmt_monitor/metric_definitions.rb +118 -0
  61. data/lib/2018-01-01/generated/azure_mgmt_monitor/metrics.rb +199 -0
  62. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/aggregation_type.rb +20 -0
  63. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  64. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/localizable_string.rb +57 -0
  65. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metadata_value.rb +58 -0
  66. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric.rb +105 -0
  67. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric_availability.rb +60 -0
  68. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric_definition.rb +184 -0
  69. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric_definition_collection.rb +56 -0
  70. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric_value.rb +104 -0
  71. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/response.rb +120 -0
  72. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/result_type.rb +16 -0
  73. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/time_series_element.rb +79 -0
  74. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/unit.rb +23 -0
  75. data/lib/2018-01-01/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  76. data/lib/2018-01-01/generated/azure_mgmt_monitor/monitor_management_client.rb +131 -0
  77. data/lib/2018-03-01/generated/azure_mgmt_monitor.rb +57 -0
  78. data/lib/2018-03-01/generated/azure_mgmt_monitor/action_groups.rb +693 -0
  79. data/lib/2018-03-01/generated/azure_mgmt_monitor/metric_alerts.rb +582 -0
  80. data/lib/2018-03-01/generated/azure_mgmt_monitor/metric_alerts_status.rb +213 -0
  81. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/action_group_list.rb +67 -0
  82. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/action_group_patch_body.rb +68 -0
  83. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/action_group_resource.rb +304 -0
  84. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/automation_runbook_receiver.rb +102 -0
  85. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/azure_app_push_receiver.rb +58 -0
  86. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/azure_function_receiver.rb +80 -0
  87. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/email_receiver.rb +72 -0
  88. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/enable_request.rb +46 -0
  89. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  90. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/itsm_receiver.rb +94 -0
  91. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/logic_app_receiver.rb +69 -0
  92. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_action.rb +65 -0
  93. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_criteria.rb +65 -0
  94. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_resource.rb +226 -0
  95. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_resource_collection.rb +56 -0
  96. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_resource_patch.rb +194 -0
  97. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_single_resource_multiple_metric_criteria.rb +88 -0
  98. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_status.rb +81 -0
  99. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_status_collection.rb +56 -0
  100. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_status_properties.rb +76 -0
  101. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_criteria.rb +122 -0
  102. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_dimension.rb +77 -0
  103. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/receiver_status.rb +17 -0
  104. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/resource.rb +101 -0
  105. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/sms_receiver.rb +83 -0
  106. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/voice_receiver.rb +69 -0
  107. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/webhook_receiver.rb +58 -0
  108. data/lib/2018-03-01/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  109. data/lib/2018-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +138 -0
  110. data/lib/2018-04-16/generated/azure_mgmt_monitor.rb +46 -0
  111. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/action.rb +47 -0
  112. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/alert_severity.rb +19 -0
  113. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/alerting_action.rb +99 -0
  114. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/az_ns_action_group.rb +78 -0
  115. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/conditional_operator.rb +17 -0
  116. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/enabled.rb +16 -0
  117. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  118. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/log_metric_trigger.rb +83 -0
  119. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/log_search_rule_resource.rb +174 -0
  120. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/log_search_rule_resource_collection.rb +56 -0
  121. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/log_search_rule_resource_patch.rb +67 -0
  122. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/metric_trigger_type.rb +16 -0
  123. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/provisioning_state.rb +18 -0
  124. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/query_type.rb +15 -0
  125. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/resource.rb +101 -0
  126. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/schedule.rb +59 -0
  127. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/source.rb +89 -0
  128. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/trigger_condition.rb +72 -0
  129. data/lib/2018-04-16/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  130. data/lib/2018-04-16/generated/azure_mgmt_monitor/monitor_client.rb +130 -0
  131. data/lib/2018-04-16/generated/azure_mgmt_monitor/scheduled_query_rules.rb +610 -0
  132. data/lib/azure_mgmt_monitor.rb +5 -2
  133. data/lib/profiles/latest/modules/monitor_profile_module.rb +119 -45
  134. data/lib/version.rb +1 -1
  135. metadata +113 -3
@@ -0,0 +1,190 @@
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::V2017_05_01_preview
7
+ #
8
+ # Monitor Management Client
9
+ #
10
+ class Metrics
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Metrics 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
+ # **Lists the metric values for a resource**.
26
+ #
27
+ # @param resource_uri [String] The identifier of the resource.
28
+ # @param timespan [String] The timespan of the query. It is a string with the
29
+ # following format 'startDateTime_ISO/endDateTime_ISO'.
30
+ # @param interval [Duration] The interval (i.e. timegrain) of the query.
31
+ # @param metric [String] The name of the metric to retrieve.
32
+ # @param aggregation [String] The list of aggregation types (comma separated)
33
+ # to retrieve.
34
+ # @param top [Float] The maximum number of records to retrieve.
35
+ # Valid only if $filter is specified.
36
+ # Defaults to 10.
37
+ # @param orderby [String] The aggregation to use for sorting results and the
38
+ # direction of the sort.
39
+ # Only one order can be specified.
40
+ # Examples: sum asc.
41
+ # @param filter [String] The **$filter** is used to reduce the set of metric
42
+ # data returned.<br>Example:<br>Metric contains metadata A, B and C.<br>-
43
+ # Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq
44
+ # ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- Invalid
45
+ # variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B =
46
+ # ‘b2’**<br>This is invalid because the logical or operator cannot separate two
47
+ # different metadata names.<br>- Return all time series where A = a1, B = b1
48
+ # and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return
49
+ # all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq
50
+ # ‘*’**.
51
+ # @param result_type [ResultType] Reduces the set of data collected. The syntax
52
+ # allowed depends on the operation. See the operation's description for
53
+ # details. Possible values include: 'Data', 'Metadata'
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [Response] operation results.
58
+ #
59
+ def list(resource_uri, timespan:nil, interval:nil, metric:nil, aggregation:nil, top:nil, orderby:nil, filter:nil, result_type:nil, custom_headers:nil)
60
+ response = list_async(resource_uri, timespan:timespan, interval:interval, metric:metric, aggregation:aggregation, top:top, orderby:orderby, filter:filter, result_type:result_type, custom_headers:custom_headers).value!
61
+ response.body unless response.nil?
62
+ end
63
+
64
+ #
65
+ # **Lists the metric values for a resource**.
66
+ #
67
+ # @param resource_uri [String] The identifier of the resource.
68
+ # @param timespan [String] The timespan of the query. It is a string with the
69
+ # following format 'startDateTime_ISO/endDateTime_ISO'.
70
+ # @param interval [Duration] The interval (i.e. timegrain) of the query.
71
+ # @param metric [String] The name of the metric to retrieve.
72
+ # @param aggregation [String] The list of aggregation types (comma separated)
73
+ # to retrieve.
74
+ # @param top [Float] The maximum number of records to retrieve.
75
+ # Valid only if $filter is specified.
76
+ # Defaults to 10.
77
+ # @param orderby [String] The aggregation to use for sorting results and the
78
+ # direction of the sort.
79
+ # Only one order can be specified.
80
+ # Examples: sum asc.
81
+ # @param filter [String] The **$filter** is used to reduce the set of metric
82
+ # data returned.<br>Example:<br>Metric contains metadata A, B and C.<br>-
83
+ # Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq
84
+ # ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- Invalid
85
+ # variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B =
86
+ # ‘b2’**<br>This is invalid because the logical or operator cannot separate two
87
+ # different metadata names.<br>- Return all time series where A = a1, B = b1
88
+ # and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return
89
+ # all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq
90
+ # ‘*’**.
91
+ # @param result_type [ResultType] Reduces the set of data collected. The syntax
92
+ # allowed depends on the operation. See the operation's description for
93
+ # details. Possible values include: 'Data', 'Metadata'
94
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
95
+ # will be added to the HTTP request.
96
+ #
97
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
98
+ #
99
+ def list_with_http_info(resource_uri, timespan:nil, interval:nil, metric:nil, aggregation:nil, top:nil, orderby:nil, filter:nil, result_type:nil, custom_headers:nil)
100
+ list_async(resource_uri, timespan:timespan, interval:interval, metric:metric, aggregation:aggregation, top:top, orderby:orderby, filter:filter, result_type:result_type, custom_headers:custom_headers).value!
101
+ end
102
+
103
+ #
104
+ # **Lists the metric values for a resource**.
105
+ #
106
+ # @param resource_uri [String] The identifier of the resource.
107
+ # @param timespan [String] The timespan of the query. It is a string with the
108
+ # following format 'startDateTime_ISO/endDateTime_ISO'.
109
+ # @param interval [Duration] The interval (i.e. timegrain) of the query.
110
+ # @param metric [String] The name of the metric to retrieve.
111
+ # @param aggregation [String] The list of aggregation types (comma separated)
112
+ # to retrieve.
113
+ # @param top [Float] The maximum number of records to retrieve.
114
+ # Valid only if $filter is specified.
115
+ # Defaults to 10.
116
+ # @param orderby [String] The aggregation to use for sorting results and the
117
+ # direction of the sort.
118
+ # Only one order can be specified.
119
+ # Examples: sum asc.
120
+ # @param filter [String] The **$filter** is used to reduce the set of metric
121
+ # data returned.<br>Example:<br>Metric contains metadata A, B and C.<br>-
122
+ # Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq
123
+ # ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- Invalid
124
+ # variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B =
125
+ # ‘b2’**<br>This is invalid because the logical or operator cannot separate two
126
+ # different metadata names.<br>- Return all time series where A = a1, B = b1
127
+ # and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return
128
+ # all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq
129
+ # ‘*’**.
130
+ # @param result_type [ResultType] Reduces the set of data collected. The syntax
131
+ # allowed depends on the operation. See the operation's description for
132
+ # details. Possible values include: 'Data', 'Metadata'
133
+ # @param [Hash{String => String}] A hash of custom headers that will be added
134
+ # to the HTTP request.
135
+ #
136
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
137
+ #
138
+ def list_async(resource_uri, timespan:nil, interval:nil, metric:nil, aggregation:nil, top:nil, orderby:nil, filter:nil, result_type:nil, custom_headers:nil)
139
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
140
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
141
+
142
+
143
+ request_headers = {}
144
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
145
+
146
+ # Set Headers
147
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
148
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
149
+ path_template = '{resourceUri}/providers/microsoft.insights/metrics'
150
+
151
+ request_url = @base_url || @client.base_url
152
+
153
+ options = {
154
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
155
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
156
+ query_params: {'timespan' => timespan,'interval' => interval,'metric' => metric,'aggregation' => aggregation,'$top' => top,'$orderby' => orderby,'$filter' => filter,'resultType' => result_type,'api-version' => @client.api_version},
157
+ headers: request_headers.merge(custom_headers || {}),
158
+ base_url: request_url
159
+ }
160
+ promise = @client.make_request_async(:get, path_template, options)
161
+
162
+ promise = promise.then do |result|
163
+ http_response = result.response
164
+ status_code = http_response.status
165
+ response_content = http_response.body
166
+ unless status_code == 200
167
+ error_model = JSON.load(response_content)
168
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
169
+ end
170
+
171
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
172
+ # Deserialize Response
173
+ if status_code == 200
174
+ begin
175
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
176
+ result_mapper = Azure::Monitor::Mgmt::V2017_05_01_preview::Models::Response.mapper()
177
+ result.body = @client.deserialize(result_mapper, parsed_response)
178
+ rescue Exception => e
179
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
180
+ end
181
+ end
182
+
183
+ result
184
+ end
185
+
186
+ promise.execute
187
+ end
188
+
189
+ end
190
+ end
@@ -0,0 +1,20 @@
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::V2017_05_01_preview
7
+ module Models
8
+ #
9
+ # Defines values for AggregationType
10
+ #
11
+ module AggregationType
12
+ None = "None"
13
+ Average = "Average"
14
+ Count = "Count"
15
+ Minimum = "Minimum"
16
+ Maximum = "Maximum"
17
+ Total = "Total"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,57 @@
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::V2017_05_01_preview
7
+ module Models
8
+ #
9
+ # The localizable string class.
10
+ #
11
+ class LocalizableString
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] the invariant value.
16
+ attr_accessor :value
17
+
18
+ # @return [String] the locale specific value.
19
+ attr_accessor :localized_value
20
+
21
+
22
+ #
23
+ # Mapper for LocalizableString class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'LocalizableString',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'LocalizableString',
34
+ model_properties: {
35
+ value: {
36
+ client_side_validation: true,
37
+ required: true,
38
+ serialized_name: 'value',
39
+ type: {
40
+ name: 'String'
41
+ }
42
+ },
43
+ localized_value: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: 'localizedValue',
47
+ type: {
48
+ name: 'String'
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,58 @@
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::V2017_05_01_preview
7
+ module Models
8
+ #
9
+ # Represents a metric metadata value.
10
+ #
11
+ class MetadataValue
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [LocalizableString] the name of the metadata.
16
+ attr_accessor :name
17
+
18
+ # @return [String] the value of the metadata.
19
+ attr_accessor :value
20
+
21
+
22
+ #
23
+ # Mapper for MetadataValue class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'MetadataValue',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'MetadataValue',
34
+ model_properties: {
35
+ name: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'name',
39
+ type: {
40
+ name: 'Composite',
41
+ class_name: 'LocalizableString'
42
+ }
43
+ },
44
+ value: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ serialized_name: 'value',
48
+ type: {
49
+ name: 'String'
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,105 @@
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::V2017_05_01_preview
7
+ module Models
8
+ #
9
+ # The result data of a query.
10
+ #
11
+ class Metric
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] the metric Id.
16
+ attr_accessor :id
17
+
18
+ # @return [String] the resource type of the metric resource.
19
+ attr_accessor :type
20
+
21
+ # @return [LocalizableString] the name and the display name of the
22
+ # metric, i.e. it is localizable string.
23
+ attr_accessor :name
24
+
25
+ # @return [Unit] the unit of the metric. Possible values include:
26
+ # 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond',
27
+ # 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified'
28
+ attr_accessor :unit
29
+
30
+ # @return [Array<TimeSeriesElement>] the time series returned when a data
31
+ # query is performed.
32
+ attr_accessor :timeseries
33
+
34
+
35
+ #
36
+ # Mapper for Metric class as Ruby Hash.
37
+ # This will be used for serialization/deserialization.
38
+ #
39
+ def self.mapper()
40
+ {
41
+ client_side_validation: true,
42
+ required: false,
43
+ serialized_name: 'Metric',
44
+ type: {
45
+ name: 'Composite',
46
+ class_name: 'Metric',
47
+ model_properties: {
48
+ id: {
49
+ client_side_validation: true,
50
+ required: true,
51
+ serialized_name: 'id',
52
+ type: {
53
+ name: 'String'
54
+ }
55
+ },
56
+ type: {
57
+ client_side_validation: true,
58
+ required: true,
59
+ serialized_name: 'type',
60
+ type: {
61
+ name: 'String'
62
+ }
63
+ },
64
+ name: {
65
+ client_side_validation: true,
66
+ required: true,
67
+ serialized_name: 'name',
68
+ type: {
69
+ name: 'Composite',
70
+ class_name: 'LocalizableString'
71
+ }
72
+ },
73
+ unit: {
74
+ client_side_validation: true,
75
+ required: true,
76
+ serialized_name: 'unit',
77
+ type: {
78
+ name: 'Enum',
79
+ module: 'Unit'
80
+ }
81
+ },
82
+ timeseries: {
83
+ client_side_validation: true,
84
+ required: true,
85
+ serialized_name: 'timeseries',
86
+ type: {
87
+ name: 'Sequence',
88
+ element: {
89
+ client_side_validation: true,
90
+ required: false,
91
+ serialized_name: 'TimeSeriesElementElementType',
92
+ type: {
93
+ name: 'Composite',
94
+ class_name: 'TimeSeriesElement'
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,60 @@
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::V2017_05_01_preview
7
+ module Models
8
+ #
9
+ # Metric availability specifies the time grain (aggregation interval or
10
+ # frequency) and the retention period for that time grain.
11
+ #
12
+ class MetricAvailability
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [Duration] the time grain specifies the aggregation interval
17
+ # for the metric. Expressed as a duration 'PT1M', 'P1D', etc.
18
+ attr_accessor :time_grain
19
+
20
+ # @return [Duration] the retention period for the metric at the specified
21
+ # timegrain. Expressed as a duration 'PT1M', 'P1D', etc.
22
+ attr_accessor :retention
23
+
24
+
25
+ #
26
+ # Mapper for MetricAvailability class as Ruby Hash.
27
+ # This will be used for serialization/deserialization.
28
+ #
29
+ def self.mapper()
30
+ {
31
+ client_side_validation: true,
32
+ required: false,
33
+ serialized_name: 'MetricAvailability',
34
+ type: {
35
+ name: 'Composite',
36
+ class_name: 'MetricAvailability',
37
+ model_properties: {
38
+ time_grain: {
39
+ client_side_validation: true,
40
+ required: false,
41
+ serialized_name: 'timeGrain',
42
+ type: {
43
+ name: 'TimeSpan'
44
+ }
45
+ },
46
+ retention: {
47
+ client_side_validation: true,
48
+ required: false,
49
+ serialized_name: 'retention',
50
+ type: {
51
+ name: 'TimeSpan'
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ end
58
+ end
59
+ end
60
+ end