query_resources
Creates, updates, deletes, gets or lists a query_resources resource.
Overview
| Name | query_resources |
| Type | Resource |
| Id | azure.monitor_query_metrics.query_resources |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
query_resources | exec | subscription_id, metricnamespace, metricnames, endpoint | starttime, endtime, interval, aggregation, top, orderby, filter, rollupby | Lists the metric values for multiple resources. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
endpoint | string | The service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: ) |
metricnames | array | The names of the metrics (comma separated) to retrieve. Required. |
metricnamespace | string | Metric namespace that contains the requested metric names. Required. |
subscription_id | string | The subscription identifier for the resources in this batch. Required. |
aggregation | string | The list of aggregation types (comma separated) to retrieve. Examples: average, minimum, maximum. Default value is None. |
endtime | string | The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. Default value is None. |
filter | string | The filter is used to reduce the set of metric data returned.Example:Metric contains metadata A, B and C.- Return all time series of C where A = a1 and B = b1 or b2filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’- Invalid variant:filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’This is invalid because the logical or operator cannot separate two different metadata names.- Return all time series where A = a1, B = b1 and C = c1:filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’- Return all time series where A = a1filter=A eq ‘a1’ and B eq ‘’ and C eq ‘*’. Default value is None. |
interval | string | The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. Examples: PT15M, PT1H, P1D, FULL. Default value is None. |
orderby | string | 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. |
rollupby | string | Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. Default value is None. |
starttime | string | The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required. If only starttime is specified, then endtime defaults to the current time. If no time interval is specified, the default is 1 hour. Default value is None. |
top | integer | The maximum number of records to retrieve per resource ID in the request. Valid only if filter is specified. Defaults to 10. Default value is None. |
Lifecycle Methods
- query_resources
Lists the metric values for multiple resources.
EXEC azure.monitor_query_metrics.query_resources.query_resources
@subscription_id='{{ subscription_id }}' --required,
@metricnamespace='{{ metricnamespace }}' --required,
@metricnames='{{ metricnames }}' --required,
@endpoint='{{ endpoint }}' --required,
@starttime='{{ starttime }}',
@endtime='{{ endtime }}',
@interval='{{ interval }}',
@aggregation='{{ aggregation }}',
@top='{{ top }}',
@orderby='{{ orderby }}',
@filter='{{ filter }}',
@rollupby='{{ rollupby }}'
;