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.objectMetricsOperations
Constructor
MetricsOperations(client, config, serializer, deserializer)
Parameters
- client
Client for service requests.
- config
Configuration of service client.
- serializer
An object model serializer.
- deserializer
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.
list(resource_uri: str, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable[azure.mgmt.monitor.v2016_09_01.models._models_py3.MetricCollection]
Parameters
- filter
- str
Reduces the set of data collected.:code:The filter is optional. If present it must contain a list of metric names to retrieve of the form: *(name.value eq 'metricName' [or name.value eq 'metricName' or ...])*. Optionally, the filter can contain conditions for the following attributes *aggregationType*, *startTime*, *endTime*, and *timeGrain* of the form *attributeName operator value*. Where operator is one of *ne*, *eq*, *gt*, *lt*.:code:Several conditions can be combined with parentheses and logical operators, e.g: *and*, *or*.:code:Some example filter expressions are::code:
-
$filter=(name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and startTime eq
2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration'PT1M',:code:
-
$filter=(name.value eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq
'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq
duration'PT1H',:code:
- $filter=(name.value eq 'ActionsCompleted' or name.value eq
'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime
eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq
duration'PT1M'.:code:<br>NOTE: When a metrics query comes in with
multiple metrics, but with no aggregation types defined, the service will pick the Primary
aggregation type of the first metrics to be used as the default aggregation type for all the
metrics.
- cls
- callable
A custom type or function that will be passed the direct response
Returns
An iterator like instance of either MetricCollection or the result of cls(response)
Return type
Exceptions
Attributes
models
models = <module 'azure.mgmt.monitor.v2016_09_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\monitor\\v2016_09_01\\models\\__init__.py'>
Feedback
Submit and view feedback for