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.
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
- timespan
- str
The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.
- top
- int
The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10.
- orderby
- str
The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum asc.
- filter
- 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 ''.
- result_type
- str or <xref:$>(<xref:python-base-namespace>)ResultType
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
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'>
Feedback
Submit and view feedback for