MetricsOperations Class

MetricsOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
MetricsOperations

Constructor

MetricsOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

Methods

list

Lists the metric values for a resource.

list

Lists the metric values for a resource.

async list(resource_uri: str, timespan: Optional[str] = None, interval: Optional[datetime.timedelta] = None, metric: Optional[str] = None, aggregation: Optional[str] = None, top: Optional[int] = None, orderby: Optional[str] = None, filter: Optional[str] = None, result_type: Optional[Union[str, azure.mgmt.monitor.v2017_05_01_preview.models._monitor_management_client_enums.ResultType]] = None, **kwargs: Any) -> azure.mgmt.monitor.v2017_05_01_preview.models._models_py3.Response

Parameters

resource_uri
str
Required

The identifier of the resource.

timespan
str
Required

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

interval
timedelta
Required

The interval (i.e. timegrain) of the query.

metric
str
Required

The name of the metric to retrieve.

aggregation
str
Required

The list of aggregation types (comma separated) to retrieve.

top
int
Required

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

orderby
str
Required

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

filter
str
Required

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 ''.

result_type
str or <xref:$>(<xref:python-base-namespace>)ResultType
Required

Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details.

cls
callable

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

Returns

Response, or the result of cls(response)

Return type

<xref:$>(<xref:python-base-namespace>)Response

Exceptions

Attributes

models

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