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?metricnames={metricnames}&metricnamespace={metricnamespace}×pan={timespan}&interval={interval}&aggregation={aggregation}&sensitivities={sensitivities}&$filter={$filter}&resultType={resultType}&api-version=2019-03-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string |
The identifier of the resource. |
api-version
|
query | True |
string |
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 to query metric definitions for. |
|
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 |
Successful request to get the list of metric baseline values. |
|
Other Status Codes |
Error response describing why the operation failed. |
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?timespan=2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z&interval=PT1H&aggregation=average&sensitivities=Low,Medium&api-version=2019-03-01
Sample Response
{
"value": [
{
"id": "/subscriptions/11aeb0ed-456b-4ca0-8df5-b9fbdc63d0d3/resourceGroups/SmartAnalytics-DEV-VM/providers/Microsoft.Compute/virtualMachines/DemoVM1/providers/microsoft.insights/metricBaselines/Percentage CPU",
"type": "microsoft.insights/metricBaselines",
"name": "Percentage CPU",
"properties": {
"interval": "PT1H",
"timespan": "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z",
"namespace": "microsoft.compute/virtualmachines",
"baselines": [
{
"aggregation": "average",
"dimensions": [],
"metadataValues": [
{
"name": "ErrorType",
"value": "TooManyAnomalies"
},
{
"name": "SeasonalityFrequency",
"value": "288"
}
],
"timestamps": [
"2019-03-12T11:00:00.000Z",
"2019-03-12T12:00:00.000Z"
],
"data": [
{
"sensitivity": "Low",
"lowThresholds": [
30,
31.1
],
"highThresholds": [
90.3453,
91.3453
]
},
{
"sensitivity": "Medium",
"lowThresholds": [
50,
51.1
],
"highThresholds": [
70.3453,
71.3453
]
}
]
}
]
}
}
]
}
Definitions
Name | Description |
---|---|
Baseline |
Represents a baseline metadata value. |
Baseline |
the sensitivity of the baseline. |
Error |
Describes the format of Error response. |
Metric |
A list of metric baselines. |
Metric |
The metric dimension name and value. |
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.
Name | Type | Description |
---|---|---|
High |
string |
|
Low |
string |
|
Medium |
string |
ErrorResponse
Describes the format of Error response.
Name | Type | Description |
---|---|---|
code |
string |
Error code |
message |
string |
Error message indicating why the operation failed. |
MetricBaselinesResponse
A list of metric baselines.
Name | Type | Description |
---|---|---|
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. |
ResultType
Allows retrieving only metadata of the baseline. On data request all information is retrieved.
Name | Type | Description |
---|---|---|
Data |
string |
|
Metadata |
string |
SingleBaseline
The baseline values for a single sensitivity value.
Name | Type | Description |
---|---|---|
highThresholds |
number[] |
The high thresholds of the baseline. |
lowThresholds |
number[] |
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 |
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[] |
The list of timestamps of the baselines. |