Baselines - List
Lists the metric baseline values for a resource.
GET https://management.azure.com/{resourceUri}/providers/Microsoft.Insights/metricBaselines?api-version=2019-03-01
GET https://management.azure.com/{resourceUri}/providers/Microsoft.Insights/metricBaselines?api-version=2019-03-01&metricnames={metricnames}&metricnamespace={metricnamespace}×pan={timespan}&interval={interval}&aggregation={aggregation}&sensitivities={sensitivities}&$filter={$filter}&resultType={resultType}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string |
The fully qualified Azure Resource manager identifier of the resource. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
|
$filter
|
query |
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 b2 $filter=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 = a1 $filter=A eq 'a1' and B eq '' and C eq ''. Special case: When dimension name or dimension value uses round brackets. Eg: When dimension name is dim (test) 1 Instead of using $filter= "dim (test) 1 eq '' " use **$filter= "dim %2528test%2529 1 eq '' "** When dimension name is dim (test) 3 and dimension value is dim3 (test) val Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use $filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' " |
|
|
aggregation
|
query |
string |
The list of aggregation types (comma separated) to retrieve. |
|
|
interval
|
query |
string (duration) |
The interval (i.e. timegrain) of the query. |
|
|
metricnames
|
query |
string |
The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be 'Metric%2Name1' |
|
|
metricnamespace
|
query |
string |
Metric namespace that contains the requested metric names. |
|
|
result
|
query |
Allows retrieving only metadata of the baseline. On data request all information is retrieved. |
||
|
sensitivities
|
query |
string |
The list of sensitivities (comma separated) to retrieve. |
|
|
timespan
|
query |
string |
The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
The request has succeeded. |
|
| Other Status Codes |
An unexpected error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
Get metric baselines
Sample request
GET https://management.azure.com/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/metricBaselines?api-version=2019-03-01×pan=2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z&interval=PT1H&aggregation=average&sensitivities=Low,Medium
Sample response
{
"value": [
{
"name": "Percentage CPU",
"type": "microsoft.insights/metricBaselines",
"id": "/subscriptions/11aeb0ed-456b-4ca0-8df5-b9fbdc63d0d3/resourceGroups/SmartAnalytics-DEV-VM/providers/Microsoft.Compute/virtualMachines/DemoVM1/providers/microsoft.insights/metricBaselines/Percentage CPU",
"properties": {
"baselines": [
{
"aggregation": "average",
"data": [
{
"highThresholds": [
90.3453,
91.3453
],
"lowThresholds": [
30,
31.1
],
"sensitivity": "Low"
},
{
"highThresholds": [
70.3453,
71.3453
],
"lowThresholds": [
50,
51.1
],
"sensitivity": "Medium"
}
],
"dimensions": [],
"metadataValues": [
{
"name": "ErrorType",
"value": "TooManyAnomalies"
},
{
"name": "SeasonalityFrequency",
"value": "288"
}
],
"timestamps": [
"2019-03-12T11:00:00.000Z",
"2019-03-12T12:00:00.000Z"
]
}
],
"interval": "PT1H",
"namespace": "microsoft.compute/virtualmachines",
"timespan": "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"
}
}
]
}
Definitions
| Name | Description |
|---|---|
|
Baseline |
Represents a baseline metadata value. |
|
Baseline |
the sensitivity of the baseline. |
|
Metric |
Describes the format of Error response. |
|
Metric |
A list of metric baselines. |
|
Metric |
The metric dimension name and value. |
|
Microsoft. |
Describes details of an error response. |
|
Microsoft. |
|
|
Microsoft. |
|
|
Microsoft. |
|
|
Result |
Allows retrieving only metadata of the baseline. On data request all information is retrieved. |
|
Single |
The baseline values for a single sensitivity value. |
|
Single |
The baseline results of a single metric. |
|
Time |
The baseline values for a single time series. |
BaselineMetadata
Represents a baseline metadata value.
| Name | Type | Description |
|---|---|---|
| name |
string |
Name of the baseline metadata. |
| value |
string |
Value of the baseline metadata. |
BaselineSensitivity
the sensitivity of the baseline.
| Value | Description |
|---|---|
| Low |
Low |
| Medium |
Medium |
| High |
High |
MetricBaselinesErrorResponse
Describes the format of Error response.
| Name | Type | Description |
|---|---|---|
| error |
MetricBaselinesResponse
A list of metric baselines.
| Name | Type | Description |
|---|---|---|
| nextLink |
string |
The URL to get the next set of results. |
| value |
The list of metric baselines. |
MetricSingleDimension
The metric dimension name and value.
| Name | Type | Description |
|---|---|---|
| name |
string |
Name of the dimension. |
| value |
string |
Value of the dimension. |
Microsoft.Common.ErrorDetail
Describes details of an error response.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
An array of objects with 'type' and 'info' properties. The schema of 'info' is service-specific and dependent on the 'type' string. |
|
| code |
string |
Unlocalized string which can be used to programmatically identify the error. |
| message |
string |
Describes the error in detail and provides debugging information. |
| target |
string |
The target of the particular error (for example, the name of the property in error). |
Microsoft.Common.ErrorDetailAdditionalInfoItem
| Name | Type | Description |
|---|---|---|
| info |
management.azure.com.monitor.baselines.list |
The additional information specific to the type. |
| type |
string |
The type of additional information. |
Microsoft.Common.ErrorResponseError
| Name | Type | Description |
|---|---|---|
| additionalInfo |
An array of objects with 'type' and 'info' properties. The schema of 'info' is service-specific and dependent on the 'type' string. |
|
| code |
string |
Unlocalized string which can be used to programmatically identify the error. |
| details |
An array of additional nested error response info objects, as described by this contract. |
|
| message |
string |
Describes the error in detail and provides debugging information. If Accept-Language is set in the request, it must be localized to that language. |
| target |
string |
The target of the particular error (for example, the name of the property in error). |
Microsoft.Common.ErrorResponseErrorAdditionalInfoItem
| Name | Type | Description |
|---|---|---|
| info |
management.azure.com.monitor.baselines.list |
The additional information specific to the type. |
| type |
string |
The type of additional information. |
ResultType
Allows retrieving only metadata of the baseline. On data request all information is retrieved.
| Value | Description |
|---|---|
| Data |
Data |
| Metadata |
Metadata |
SingleBaseline
The baseline values for a single sensitivity value.
| Name | Type | Description |
|---|---|---|
| highThresholds |
number[] (double) |
The high thresholds of the baseline. |
| lowThresholds |
number[] (double) |
The low thresholds of the baseline. |
| sensitivity |
the sensitivity of the baseline. |
SingleMetricBaseline
The baseline results of a single metric.
| Name | Type | Description |
|---|---|---|
| id |
string |
The metric baseline Id. |
| name |
string |
The name of the metric for which the baselines were retrieved. |
| properties.baselines |
The baseline for each time series that was queried. |
|
| properties.interval |
string (duration) |
The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. |
| properties.namespace |
string |
The namespace of the metrics been queried. |
| properties.timespan |
string |
The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. |
| type |
string |
The resource type of the metric baseline resource. |
TimeSeriesBaseline
The baseline values for a single time series.
| Name | Type | Description |
|---|---|---|
| aggregation |
string |
The aggregation type of the metric. |
| data |
The baseline values for each sensitivity. |
|
| dimensions |
The dimensions of this time series. |
|
| metadataValues |
The baseline metadata values. |
|
| timestamps |
string[] (date-time) |
The list of timestamps of the baselines. |