Predictive Metric - Get

get predictive autoscale metric future data

GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics?timespan={timespan}&interval={interval}&metricNamespace={metricNamespace}&metricName={metricName}&aggregation={aggregation}&api-version=2022-10-01

URI Parameters

Name In Required Type Description
autoscaleSettingName
path True

string

The autoscale setting name.

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

The ID of the target subscription.

aggregation
query True

string

The list of aggregation types (comma separated) to retrieve.

api-version
query True

string

The API version to use for this operation.

interval
query True

string

duration

The interval (i.e. timegrain) of the query.

metricName
query True

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 True

string

Metric namespace to query metric definitions for.

timespan
query True

string

The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.

Responses

Name Type Description
200 OK

PredictiveResponse

Successful request to get the list of metric values.

Other Status Codes

AutoscaleErrorResponse

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 for data

Sample request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myRG/providers/Microsoft.Insights/autoscalesettings/vmss1-Autoscale-775/predictiveMetrics?timespan=2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z&interval=PT1H&metricNamespace=Microsoft.Compute/virtualMachineScaleSets&metricName=PercentageCPU&aggregation=Total&api-version=2022-10-01

Sample response

{
  "timespan": "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z",
  "interval": "PT1H",
  "metricName": "PercentageCPU",
  "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1",
  "data": [
    {
      "timeStamp": "2021-10-14T22:00:00Z",
      "value": 123
    },
    {
      "timeStamp": "2021-10-14T22:02:00Z",
      "value": 120
    },
    {
      "timeStamp": "2021-10-14T22:02:00Z",
      "value": 88
    },
    {
      "timeStamp": "2021-10-14T22:03:00Z",
      "value": 100
    }
  ]
}

Definitions

Name Description
AutoscaleErrorResponse

Describes the format of Error response.

createdByType

The type of identity that created the resource.

Error

The error object.

PredictiveResponse

The response to a metrics query.

PredictiveValue

Represents a predictive metric value in the given bucket.

systemData

Metadata pertaining to creation and last modification of the resource.

AutoscaleErrorResponse

Describes the format of Error response.

Name Type Description
error

Error

The error object.

systemData

systemData

The system metadata related to the response.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

string

A human-readable representation of the error's details.

message

string

A human-readable representation of the error.

target

string

The target of the particular error.

PredictiveResponse

The response to a metrics query.

Name Type Description
data

PredictiveValue[]

the value of the collection.

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.

metricName

string

The metrics being queried

targetResourceId

string

resource of the predictive metric.

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.

PredictiveValue

Represents a predictive metric value in the given bucket.

Name Type Description
timeStamp

string

the timestamp for the metric value in ISO 8601 format.

value

number

Predictive value in this time bucket.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.