diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json new file mode 100644 index 000000000000..788b72e76039 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "resourceUri": "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1", + "timespan": "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z", + "metricName": "Percentage Cpu", + "aggregation": "average", + "interval": "PT1H", + "sensitivities": "Low,Medium", + "api-version": "2019-03-01" + }, + "responses": { + "200": { + "body": { + "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": [], + "metadata": [{ + "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.0, + 31.1], + "highThresholds": [90.3453, + 91.3453] + }, + { + "sensitivity": "Medium", + "lowThresholds": [50.0, + 51.1], + "highThresholds": [70.3453, + 71.3453] + }] + }] + } + }] + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json new file mode 100644 index 000000000000..5f107a50da50 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json @@ -0,0 +1,376 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorManagementClient", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, + "version": "2019-03-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/{resourceUri}/providers/microsoft.insights/metricBaselines": { + "get": { + "tags": [ + "Baseline", + "Metric" + ], + "operationId": "Baselines_List", + "description": "**Lists the metric baseline values for a resource**.", + "x-ms-examples": { + "Get metric baselines": { + "$ref": "./examples/metricBaselines.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceUriParameter" + }, + { + "$ref": "#/parameters/MetricNamesParameter" + }, + { + "$ref": "#/parameters/MetricNamespaceParameter" + }, + { + "$ref": "#/parameters/TimespanParameter" + }, + { + "$ref": "#/parameters/IntervalParameter" + }, + { + "$ref": "#/parameters/AggregationsParameter" + }, + { + "$ref": "#/parameters/SensitivitiesParameter" + }, + { + "name": "$filter", + "in": "query", + "type": "string", + "description": "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 ‘*’**.", + "required": false + }, + { + "$ref": "#/parameters/BaselineResultTypeParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to get the list of metric baseline values.", + "schema": { + "$ref": "#/definitions/MetricBaselinesResponse" + } + } + } + } + } + }, + "definitions": { + "ErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, + "MetricBaselinesResponse": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/SingleMetricBaseline" + }, + "description": "The list of metric baselines." + } + }, + "description": "A list of metric baselines." + }, + "SingleMetricBaseline": { + "properties": { + "id": { + "type": "string", + "description": "The metric baseline Id." + }, + "type": { + "type": "string", + "description": "The resource type of the metric baseline resource." + }, + "name": { + "type": "string", + "description": "The name of the metric for which the baselines were retrieved." + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/MetricBaselinesProperties", + "description": "The metric baseline properties of the metric." + } + }, + "required": [ "id", "type", "name", "properties" ], + "description": "The baseline results of a single metric." + }, + "MetricBaselinesProperties": { + "type": "object", + "properties": { + "timespan": { + "type": "string", + "description": "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." + }, + "interval": { + "type": "string", + "format": "duration", + "description": "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." + }, + "namespace": { + "type": "string", + "description": "The namespace of the metrics been queried." + }, + "baselines": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeSeriesBaseline" + }, + "description": "The baseline for each time series that was queried." + } + }, + "required": [ "timespan", "interval", "baselines" ], + "description": "The response to a metric baselines query." + }, + "TimeSeriesBaseline": { + "properties": { + "aggregation": { + "type": "string", + "description": "The aggregation type of the metric." + }, + "dimensions": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricSingleDimension" + }, + "description": "The dimensions of this time series." + }, + "timestamps": { + "type": "array", + "items": { + "type": "string", + "format": "date-time", + "description": "The timestamp for the baseline value in ISO 8601 format." + }, + "description": "The list of timestamps of the baselines." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SingleBaseline" + }, + "description": "The baseline values for each sensitivity." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/BaselineMetadata" + }, + "description": "The baseline metadata values." + } + }, + "required": [ "aggregation", "timestamps", "data" ], + "description": "The baseline values for a single time series." + }, + "MetricSingleDimension": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the dimension." + }, + "value": { + "type": "string", + "description": "Value of the dimension." + } + }, + "required": [ "name", "value" ], + "description": "The metric dimension name and value." + }, + "SingleBaseline": { + "type": "object", + "properties": { + "sensitivity": { + "type": "string", + "enum": [ + "Low", + "Medium", + "High" + ], + "x-ms-enum": { + "name": "BaselineSensitivity", + "modelAsString": true + }, + "description": "the sensitivity of the baseline." + }, + "lowThresholds": { + "type": "array", + "items": { + "type": "number", + "format": "double", + "description": "A single low threshold value." + }, + "description": "The low thresholds of the baseline." + }, + "highThresholds": { + "type": "array", + "items": { + "type": "number", + "format": "double", + "description": "A single high threshold value." + }, + "description": "The high thresholds of the baseline." + } + }, + "required": [ "sensitivity", "lowThresholds", "highThresholds" ], + "description": "The baseline values for a single sensitivity value." + }, + "BaselineMetadata": { + "properties": { + "name": { + "type": "string", + "description": "Name of the baseline metadata." + }, + "value": { + "type": "string", + "description": "Value of the baseline metadata." + } + }, + "required": [ "name", "value" ], + "description": "Represents a baseline metadata value." + } + }, + "parameters": { + "ResourceUriParameter": { + "name": "resourceUri", + "in": "path", + "required": true, + "type": "string", + "description": "The identifier of the resource.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "TimespanParameter": { + "name": "timespan", + "in": "query", + "required": false, + "type": "string", + "description": "The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.", + "x-ms-parameter-location": "method" + }, + "IntervalParameter": { + "name": "interval", + "in": "query", + "required": false, + "type": "string", + "format": "duration", + "description": "The interval (i.e. timegrain) of the query.", + "x-ms-parameter-location": "method" + }, + "MetricNamesParameter": { + "name": "metricnames", + "in": "query", + "required": false, + "type": "string", + "description": "The names of the metrics (comma separated) to retrieve.", + "x-ms-parameter-location": "method" + }, + "MetricNamespaceParameter": { + "name": "metricnamespace", + "in": "query", + "required": false, + "type": "string", + "description": "Metric namespace to query metric definitions for.", + "x-ms-parameter-location": "method" + }, + "AggregationsParameter": { + "name": "aggregation", + "in": "query", + "required": false, + "type": "string", + "description": "The list of aggregation types (comma separated) to retrieve.", + "x-ms-parameter-location": "method" + }, + "SensitivitiesParameter": { + "name": "sensitivities", + "in": "query", + "required": false, + "type": "string", + "description": "The list of sensitivities (comma separated) to retrieve.", + "x-ms-parameter-location": "method" + }, + "BaselineResultTypeParameter": { + "name": "resultType", + "in": "query", + "type": "string", + "enum": [ + "Data", + "Metadata" + ], + "x-ms-enum": { + "name": "ResultType", + "modelAsString": false + }, + "description": "Allows retrieving only metadata of the baseline. On data request all information is retrieved.", + "x-ms-parameter-location": "method", + "required": false + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 17458a17ed07..1154832e5f4f 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -53,6 +53,7 @@ input-file: - Microsoft.Insights/stable/2018-01-01/metrics_API.json - Microsoft.Insights/preview/2017-11-01-preview/baseline_API.json - Microsoft.Insights/preview/2017-11-01-preview/calculateBaseline_API.json +- Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json - Microsoft.Insights/stable/2018-03-01/metricAlert_API.json - Microsoft.Insights/stable/2018-04-16/scheduledQueryRule_API.json - Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json