@@ -64,7 +64,7 @@ def list(self, resource_uri: str, *, metricnamespace: Optional[str] = None, **kw
64
64
65
65
:param resource_uri: The identifier of the resource. Required.
66
66
:type resource_uri: str
67
- :keyword metricnamespace: Metric namespace to query metric definitions for . Default value is
67
+ :keyword metricnamespace: Metric namespace where the metrics you want reside . Default value is
68
68
None.
69
69
:paramtype metricnamespace: str
70
70
:return: An iterator like instance of JSON object
@@ -85,16 +85,16 @@ def list(self, resource_uri: str, *, metricnamespace: Optional[str] = None, **kw
85
85
],
86
86
"displayDescription": "str", # Optional. Detailed description of this
87
87
metric.
88
- "id": "str", # Optional. the resource identifier of the metric definition.
88
+ "id": "str", # Optional. The resource identifier of the metric definition.
89
89
"isDimensionRequired": bool, # Optional. Flag to indicate whether the
90
90
dimension is required.
91
91
"metricAvailabilities": [
92
92
{
93
- "retention": "1 day, 0:00:00", # Optional. the retention
93
+ "retention": "1 day, 0:00:00", # Optional. The retention
94
94
period for the metric at the specified timegrain. Expressed as a
95
95
duration 'PT1M', 'P1D', etc.
96
- "timeGrain": "1 day, 0:00:00" # Optional. the time grain
97
- specifies the aggregation interval for the metric. Expressed as a
96
+ "timeGrain": "1 day, 0:00:00" # Optional. The time grain
97
+ specifies a supported aggregation interval for the metric. Expressed as a
98
98
duration 'PT1M', 'P1D', etc.
99
99
}
100
100
],
@@ -104,14 +104,14 @@ def list(self, resource_uri: str, *, metricnamespace: Optional[str] = None, **kw
104
104
"value": "str", # The invariant value. Required.
105
105
"localizedValue": "str" # Optional. The display name.
106
106
},
107
- "namespace": "str", # Optional. the namespace the metric belongs to.
108
- "primaryAggregationType": "str", # Optional. the primary aggregation type
107
+ "namespace": "str", # Optional. The namespace the metric belongs to.
108
+ "primaryAggregationType": "str", # Optional. The primary aggregation type
109
109
value defining how to use the values for display. Known values are: "None",
110
110
"Average", "Count", "Minimum", "Maximum", and "Total".
111
- "resourceId": "str", # Optional. the resource identifier of the resource
111
+ "resourceId": "str", # Optional. The resource identifier of the resource
112
112
that emitted the metric.
113
113
"supportedAggregationTypes": [
114
- "str" # Optional. the collection of what aggregation types are
114
+ "str" # Optional. The collection of what aggregation types are
115
115
supported.
116
116
],
117
117
"unit": "str" # Optional. The unit of the metric. Known values are: "Count",
@@ -123,7 +123,7 @@ def list(self, resource_uri: str, *, metricnamespace: Optional[str] = None, **kw
123
123
_headers = kwargs .pop ("headers" , {}) or {}
124
124
_params = case_insensitive_dict (kwargs .pop ("params" , {}) or {})
125
125
126
- api_version : str = kwargs .pop ("api_version" , _params .pop ("api-version" , "2018-01 -01" ))
126
+ api_version : str = kwargs .pop ("api_version" , _params .pop ("api-version" , "2023-10 -01" ))
127
127
cls : ClsType [JSON ] = kwargs .pop ("cls" , None )
128
128
129
129
error_map = {
@@ -210,6 +210,9 @@ async def list(
210
210
filter : Optional [str ] = None ,
211
211
result_type : Optional [str ] = None ,
212
212
metricnamespace : Optional [str ] = None ,
213
+ auto_adjust_timegrain : Optional [bool ] = None ,
214
+ validate_dimensions : Optional [bool ] = None ,
215
+ rollupby : Optional [str ] = None ,
213
216
** kwargs : Any
214
217
) -> JSON :
215
218
# pylint: disable=line-too-long
@@ -225,41 +228,51 @@ async def list(
225
228
span requested.
226
229
*Examples: PT15M, PT1H, P1D, FULL*. Default value is None.
227
230
:paramtype interval: ~datetime.timedelta
228
- :keyword metricnames: The names of the metrics (comma separated) to retrieve. Special case: If
229
- a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be
230
- **'Metric%2Name1'**. Default value is None.
231
+ :keyword metricnames: The names of the metrics (comma separated) to retrieve. Default value is
232
+ None.
231
233
:paramtype metricnames: str
232
- :keyword aggregation: The list of aggregation types (comma separated) to retrieve. Default
233
- value is None.
234
+ :keyword aggregation: The list of aggregation types (comma separated) to retrieve.
235
+ *Examples: average, minimum, maximum*. Default value is None.
234
236
:paramtype aggregation: str
235
- :keyword top: The maximum number of records to retrieve.
236
- Valid only if $ filter is specified.
237
+ :keyword top: The maximum number of records to retrieve per resource ID in the request .
238
+ Valid only if filter is specified.
237
239
Defaults to 10. Default value is None.
238
240
:paramtype top: int
239
241
:keyword orderby: The aggregation to use for sorting results and the direction of the sort.
240
242
Only one order can be specified.
241
- Examples: sum asc. Default value is None.
243
+ * Examples: sum asc* . Default value is None.
242
244
:paramtype orderby: str
243
- :keyword filter: The **$filter** is used to reduce the set of metric data returned. Example:
244
- Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or
245
- b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A
246
- eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** This is invalid because the logical or
247
- operator cannot separate two different metadata names. - Return all time series where A = a1, B
248
- = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series
249
- where A = a1 **$filter=A eq 'a1' and B eq '\ *' and C eq '*\ '**. Special case: When dimension
250
- name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1**
251
- Instead of using $filter= "dim (test) 1 eq '\ *' " use **$filter= "dim %2528test%2529 1 eq '*\
252
- ' "\ ** When dimension name is **\ dim (test) 3\ ** and dimension value is **\ dim3 (test) val\
253
- ** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use **\ $filter= "dim
254
- %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. Default value is None.
245
+ :keyword filter: The **$filter** is used to reduce the set of metric data
246
+ returned.:code:`<br>`Example::code:`<br>`Metric contains metadata A, B and C.:code:`<br>`-
247
+ Return all time series of C where A = a1 and B = b1 or b2:code:`<br>`\ **$filter=A eq ‘a1’ and
248
+ B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**\ :code:`<br>`- Invalid variant::code:`<br>`\ **$filter=A
249
+ eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**\ :code:`<br>`This is invalid because the
250
+ logical or operator cannot separate two different metadata names.:code:`<br>`- Return all time
251
+ series where A = a1, B = b1 and C = c1::code:`<br>`\ **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq
252
+ ‘c1’**\ :code:`<br>`- Return all time series where A = a1:code:`<br>`\ **$filter=A eq ‘a1’ and
253
+ B eq ‘\ *’ and C eq ‘*\ ’**. Default value is None.
255
254
:paramtype filter: str
256
255
:keyword result_type: Reduces the set of data collected. The syntax allowed depends on the
257
256
operation. See the operation's description for details. Known values are: "Data" and
258
257
"Metadata". Default value is None.
259
258
:paramtype result_type: str
260
- :keyword metricnamespace: Metric namespace to query metric definitions for . Default value is
259
+ :keyword metricnamespace: Metric namespace where the metrics you want reside . Default value is
261
260
None.
262
261
:paramtype metricnamespace: str
262
+ :keyword auto_adjust_timegrain: When set to true, if the timespan passed in is not supported by
263
+ this metric, the API will return the result using the closest supported timespan. When set to
264
+ false, an error is returned for invalid timespan parameters. Defaults to false. Default value
265
+ is None.
266
+ :paramtype auto_adjust_timegrain: bool
267
+ :keyword validate_dimensions: When set to false, invalid filter parameter values will be
268
+ ignored. When set to true, an error is returned for invalid filter parameters. Defaults to
269
+ true. Default value is None.
270
+ :paramtype validate_dimensions: bool
271
+ :keyword rollupby: Dimension name(s) to rollup results by. For example if you only want to see
272
+ metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see
273
+ separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle
274
+ and Tacoma rolled up into one timeseries. Default value is None.
275
+ :paramtype rollupby: str
263
276
:return: JSON object
264
277
:rtype: JSON
265
278
:raises ~azure.core.exceptions.HttpResponseError:
@@ -275,7 +288,7 @@ async def list(
275
288
Required.
276
289
"value": [
277
290
{
278
- "id": "str", # the metric Id. Required.
291
+ "id": "str", # The metric Id. Required.
279
292
"name": {
280
293
"value": "str", # The invariant value. Required.
281
294
"localizedValue": "str" # Optional. The display
@@ -316,7 +329,7 @@ async def list(
316
329
]
317
330
}
318
331
],
319
- "type": "str", # the resource type of the metric resource.
332
+ "type": "str", # The resource type of the metric resource.
320
333
Required.
321
334
"unit": "str", # The unit of the metric. Required. Known
322
335
values are: "Count", "Bytes", "Seconds", "CountPerSecond",
@@ -354,7 +367,7 @@ async def list(
354
367
_headers = kwargs .pop ("headers" , {}) or {}
355
368
_params = case_insensitive_dict (kwargs .pop ("params" , {}) or {})
356
369
357
- api_version : str = kwargs .pop ("api_version" , _params .pop ("api-version" , "2018-01 -01" ))
370
+ api_version : str = kwargs .pop ("api_version" , _params .pop ("api-version" , "2023-10 -01" ))
358
371
cls : ClsType [JSON ] = kwargs .pop ("cls" , None )
359
372
360
373
_request = build_metrics_list_request (
@@ -368,6 +381,9 @@ async def list(
368
381
filter = filter ,
369
382
result_type = result_type ,
370
383
metricnamespace = metricnamespace ,
384
+ auto_adjust_timegrain = auto_adjust_timegrain ,
385
+ validate_dimensions = validate_dimensions ,
386
+ rollupby = rollupby ,
371
387
api_version = api_version ,
372
388
headers = _headers ,
373
389
params = _params ,
0 commit comments