MetricsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

MonitorManagementClient's

<xref:metrics> attribute.

Inheritance
builtins.object
MetricsOperations

Constructor

MetricsOperations(*args, **kwargs)

Methods

list

Lists the metric values for a resource.

list

Lists the metric values for a resource.

list(resource_uri: str, timespan: str | None = None, interval: timedelta | None = None, metric: str | None = None, aggregation: str | None = None, top: int | None = None, orderby: str | None = None, filter: str | None = None, result_type: str | ResultType | None = None, **kwargs: Any) -> Response

Parameters

Name Description
resource_uri
Required
str

The identifier of the resource. Required.

timespan
Required
str

The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. Default value is None.

interval
Required

The interval (i.e. timegrain) of the query. Default value is None.

metric
Required
str

The name of the metric to retrieve. Default value is None.

aggregation
Required
str

The list of aggregation types (comma separated) to retrieve. Default value is None.

top
Required
int

The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. Default value is None.

orderby
Required
str

The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum asc. Default value is None.

filter
Required
str

The $filter is used to reduce the set of metric data returned.:code:
Example::code:
Metric contains metadata A, B and C.:code:
- Return all time series of C where A = a1 and B = b1 or b2:code:
$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'<br>- Invalid variant:<br>$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'<br>This is invalid because the logical or operator cannot separate two different metadata names.:code:<br>- Return all time series where A = a1, B = b1 and C = c1:<br>$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'<br>- Return all time series where A = a1:code:
$filter=A eq 'a1' and B eq '' and C eq ''. Default value is None.

result_type
Required

Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. Known values are: "Data" and "Metadata". Default value is None.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

Response or the result of cls(response)

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.monitor.v2017_05_01_preview.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\monitor\\v2017_05_01_preview\\models\\__init__.py'>