From 8ac999c21e951a7353fe6a29e8a785177097600f Mon Sep 17 00:00:00 2001 From: Asaf Strassberg Date: Mon, 27 Nov 2017 14:51:06 +0200 Subject: [PATCH 1/4] [Monitor] Add Public Preview APIs of Metric Baseline These APIs include: 1. Getting the pre-calculated baseline of a metric 2. Calculating the baseline of a metric given the metric values --- .../2017-11-01-preview/baseline_API.json | 347 ++++++++++++++++++ .../calculateBaseline_API.json | 238 ++++++++++++ .../examples/CalculateBaseline.json | 41 +++ .../examples/GetBaseline.json | 55 +++ .../examples/GetBaselineMetadata.json | 37 ++ .../monitor/resource-manager/readme.md | 2 + 6 files changed, 720 insertions(+) create mode 100644 specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/CalculateBaseline.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaseline.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaselineMetadata.json diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json new file mode 100644 index 000000000000..976fc8b4ccb5 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json @@ -0,0 +1,347 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorManagementClient", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, + "version": "2017-11-01-preview" + }, + "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/baseline/{metricName}": { + "get": { + "tags": [ + "Baseline" + ], + "operationId": "MetricBaseline_Get", + "description": "**Gets the baseline values for a specific metric**.", + "parameters": [ + { + "$ref": "#/parameters/ResourceUriParameter" + }, + { + "$ref": "#/parameters/MetricNameParameter" + }, + { + "$ref": "#/parameters/TimespanParameter" + }, + { + "$ref": "#/parameters/IntervalParameter" + }, + { + "$ref": "#/parameters/AggregationParameter" + }, + { + "$ref": "#/parameters/SensitivitiesParameter" + }, + { + "$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 values.", + "schema": { + "$ref": "#/definitions/BaselineResponse" + }, + "examples": { + "application/json": { + "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/baseline/PercentageCpu", + "type": "Microsoft.Insights/baseline", + "name": { + "value": "PercentageCpu" + }, + "properties": { + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "aggregation": "Average", + "interval": "PT1H" + }, + "timestamps": [ + "2017-04-14T02:20:00Z", + "2017-04-14T03:20:00Z" + ], + "baseline": [ + { + "sensitivity": "Low", + "lowThresholds": [ + 30.0, + 31.1 + ], + "highThresholds": [ + 90.3453, + 91.3453 + ] + }, + { + "sensitivity": "Medium", + "lowThresholds": [ + 50.0, + 51.1 + ], + "highThresholds": [ + 70.3453, + 71.3453 + ] + } + ] + } + } + } + }, + "x-ms-examples": { + "Get Metric for data": { "$ref": "./examples/GetBaseline.json" }, + "Get Metric for metadata": { "$ref": "./examples/GetBaselineMetadata.json" } + } + } + } + }, + "definitions": { + "LocalizableString": { + "required": [ "value" ], + "properties": { + "value": { + "type": "string", + "description": "the invariant value." + }, + "localizedValue": { + "type": "string", + "description": "the locale specific value." + } + }, + "description": "The localizable string class." + }, + "BaselineProperties": { + "properties": { + "timespan": { + "type": "string", + "description": "The timespan for which the data was retrieved. Its value consists of two datatimes 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." + }, + "aggregation": { + "type": "string", + "description": "The aggregation type of the metric." + } + }, + "description": "The baseline properties class." + }, + "BaselineMetadataValue": { + "properties": { + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "the name of the metadata." + }, + "value": { + "type": "string", + "description": "the value of the metadata." + } + }, + "description": "Represents a baseline metadata value." + }, + "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" + } + } + }, + "BaselineResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "the metric baseline Id." + }, + "type": { + "type": "string", + "description": "the resource type of the baseline resource." + }, + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "the name and the display name of the metric, i.e. it is localizable string." + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/BaselineProperties", + "description": "the properties of the baseline." + }, + "timestamps": { + "type": "array", + "items": { + "type": "string", + "format": "date-time", + "description": "the timestamp for the baseline value in ISO 8601 format." + }, + "description": "the array of timestamps of the baselines." + }, + "baseline": { + "type": "array", + "items": { + "$ref": "#/definitions/Baseline" + }, + "description": "the baseline values for each sensitivity." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/BaselineMetadataValue" + }, + "description": "the baseline metadata values." + } + }, + "required": [ "id", "type", "name" ], + "description": "The response to a baseline query." + }, + "Baseline": { + "type": "object", + "properties": { + "sensitivity": { + "type": "string", + "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." + } + }, + "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 + }, + "MetricNameParameter": { + "name": "metricName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the metric to retrieve the baseline for.", + "x-ms-parameter-location": "method" + }, + "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" + }, + "AggregationParameter": { + "name": "aggregation", + "in": "query", + "required": false, + "type": "string", + "description": "The aggregation type of the metric to retrieve the baseline for.", + "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/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json new file mode 100644 index 000000000000..cf38a5f291f5 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json @@ -0,0 +1,238 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorManagementClient", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, + "version": "2017-11-01-preview" + }, + "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/calculatebaseline": { + "post": { + "tags": [ + "Baseline" + ], + "operationId": "MetricBaseline_CalculateBaseline", + "description": "**Lists the baseline values for a resource**.", + "parameters": [ + { + "$ref": "#/parameters/ResourceUriParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "TimeSeriesInformation", + "description": "Information that need to be specified to calculate a baseline on a time series.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TimeSeriesInformation" + } + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to get the list of metric values.", + "schema": { + "$ref": "#/definitions/CalculateBaselineResponse" + }, + "examples": { + "application/json": { + "type": "Microsoft.Insights/calculatebaseline", + "timestamps": [ + "2017-04-14T02:20:00Z", + "2017-04-14T03:20:00Z" + ], + "baseline": [ + { + "sensitivity": "Low", + "lowThresholds": [ + 30.0, + 31.1 + ], + "highThresholds": [ + 90.3453, + 91.3453 + ] + }, + { + "sensitivity": "Medium", + "lowThresholds": [ + 50.0, + 51.1 + ], + "highThresholds": [ + 70.3453, + 71.3453 + ] + } + ] + } + } + } + }, + "x-ms-examples": { + "Calculate baseline": { "$ref": "./examples/CalculateBaseline.json" } + } + } + } + }, + "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" + } + } + }, + "TimeSeriesInformation": { + "properties": { + "sensitivities": { + "type": "array", + "items": { + "type": "string", + "description": "the requested sensitivity for calculating the baseline." + }, + "description": "the list of sensitivities for calculating the baseline." + }, + "values": { + "type": "array", + "items": { + "type": "number", + "format": "double", + "description": "A single metric value." + }, + "description": "The metric values to calculate the baseline." + }, + "timestamps": { + "type": "array", + "items": { + "type": "string", + "format": "date-time", + "description": "the timestamp for the baseline value in ISO 8601 format." + }, + "description": "the array of timestamps of the baselines." + } + }, + "required": [ "sensitivities", "values" ], + "description": "The time series info needed for calculating the baseline." + }, + "CalculateBaselineResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "the resource type of the baseline resource." + }, + "timestamps": { + "type": "array", + "items": { + "type": "string", + "format": "date-time", + "description": "the timestamp for the baseline value in ISO 8601 format." + }, + "description": "the array of timestamps of the baselines." + }, + "baseline": { + "type": "array", + "items": { + "$ref": "#/definitions/Baseline" + }, + "description": "the baseline values for each sensitivity." + } + }, + "required": [ "type", "baseline" ], + "description": "The response to a calcualte baseline call." + }, + "Baseline": { + "type": "object", + "properties": { + "sensitivity": { + "type": "string", + "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." + } + }, + "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 + }, + "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/microsoft.insights/2017-11-01-preview/examples/CalculateBaseline.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/CalculateBaseline.json new file mode 100644 index 000000000000..acde031f29a4 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/CalculateBaseline.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "resourceUri": "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default", + "api-version": "2017-05-01-preview", + "TimeSeriesInformation": { + "sensitivities": ["Low", "Medium"], + "values": [61.0, 62.0] + } + }, + "responses": { + "200": { + "body": { + "type": "Microsoft.Insights/calculatebaseline", + "baseline": [ + { + "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/2017-11-01-preview/examples/GetBaseline.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaseline.json new file mode 100644 index 000000000000..7c1614f93f25 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaseline.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "resourceUri": "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1", + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "metricName": "PercentageCpu", + "aggregation": "Average", + "interval": "PT1H", + "sensitivities": "Low,Medium", + "api-version": "2017-11-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/baseline/PercentageCpu", + "type": "Microsoft.Insights/baseline", + "name": { + "value": "PercentageCpu" + }, + "properties": { + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "aggregation": "Average", + "interval": "PT1H" + }, + "timestamps": [ + "2017-04-14T02:20:00Z", + "2017-04-14T03:20:00Z" + ], + "baseline": [ + { + "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/2017-11-01-preview/examples/GetBaselineMetadata.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaselineMetadata.json new file mode 100644 index 000000000000..50a3d92e3824 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaselineMetadata.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "resourceUri": "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1", + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "metricName": "PercentageCpu", + "aggregation": "Average", + "interval": "PT1H", + "resulttype": "metadata", + "api-version": "2017-11-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/baseline/PercentageCpu", + "type": "Microsoft.Insights/baseline", + "name": { + "value": "PercentageCpu" + }, + "properties": { + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "aggregation": "Average", + "interval": "PT1H" + }, + "metadata": [ + { + "name": "CurrentTrainingState", + "value": "Trained" + }, + { + "name": "SelectedModel", + "value": "AdjustedBoxplot" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 4205356aedc2..ded90b43fec4 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -51,6 +51,8 @@ input-file: - microsoft.insights/2015-04-01/tenantActivityLogs_API.json - microsoft.insights/2017-05-01-preview/metricDefinitions_API.json - microsoft.insights/2017-05-01-preview/metrics_API.json +- microsoft.insights/2017-11-01-preview/baseline_API.json +- microsoft.insights/2017-11-01-preview/calculateBaseline_API.json ``` ### Tag: package-2017-08 From b0872da32a424f463686fecb13531a381207a1d5 Mon Sep 17 00:00:00 2001 From: Asaf Strassberg Date: Sun, 10 Dec 2017 17:08:25 +0200 Subject: [PATCH 2/4] Fixed comments on swagger structure --- .../2017-11-01-preview/baseline_API.json | 119 ++++++++++-------- .../calculateBaseline_API.json | 15 ++- .../examples/CalculateBaseline.json | 2 +- .../examples/GetBaseline.json | 62 ++++----- .../examples/GetBaselineMetadata.json | 26 ++-- 5 files changed, 122 insertions(+), 102 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json index 976fc8b4ccb5..199c0f635a33 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json @@ -45,7 +45,7 @@ "description": "**Gets the baseline values for a specific metric**.", "parameters": [ { - "$ref": "#/parameters/ResourceUriParameter" + "$ref": "#/parameters/ExtendedResourceUriParameter" }, { "$ref": "#/parameters/MetricNameParameter" @@ -91,36 +91,36 @@ "properties": { "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", "aggregation": "Average", - "interval": "PT1H" - }, - "timestamps": [ - "2017-04-14T02:20:00Z", - "2017-04-14T03:20:00Z" - ], - "baseline": [ - { - "sensitivity": "Low", - "lowThresholds": [ - 30.0, - 31.1 - ], - "highThresholds": [ - 90.3453, - 91.3453 - ] - }, - { - "sensitivity": "Medium", - "lowThresholds": [ - 50.0, - 51.1 - ], - "highThresholds": [ - 70.3453, - 71.3453 - ] - } - ] + "interval": "PT1H", + "timestamps": [ + "2017-04-14T02:20:00Z", + "2017-04-14T03:20:00Z" + ], + "baseline": [ + { + "sensitivity": "Low", + "lowThresholds": [ + 30.0, + 31.1 + ], + "highThresholds": [ + 90.3453, + 91.3453 + ] + }, + { + "sensitivity": "Medium", + "lowThresholds": [ + 50.0, + 51.1 + ], + "highThresholds": [ + 70.3453, + 71.3453 + ] + } + ] + } } } } @@ -147,24 +147,6 @@ }, "description": "The localizable string class." }, - "BaselineProperties": { - "properties": { - "timespan": { - "type": "string", - "description": "The timespan for which the data was retrieved. Its value consists of two datatimes 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." - }, - "aggregation": { - "type": "string", - "description": "The aggregation type of the metric." - } - }, - "description": "The baseline properties class." - }, "BaselineMetadataValue": { "properties": { "name": { @@ -197,20 +179,41 @@ "properties": { "id": { "type": "string", + "readOnly": true, "description": "the metric baseline Id." }, "type": { "type": "string", + "readOnly": true, "description": "the resource type of the baseline resource." }, "name": { "$ref": "#/definitions/LocalizableString", + "readOnly": true, "description": "the name and the display name of the metric, i.e. it is localizable string." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/BaselineProperties", "description": "the properties of the baseline." + } + }, + "description": "The response to a baseline query." + }, + "BaselineProperties": { + "properties": { + "timespan": { + "type": "string", + "description": "The timespan for which the data was retrieved. Its value consists of two datatimes 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." + }, + "aggregation": { + "type": "string", + "description": "The aggregation type of the metric." }, "timestamps": { "type": "array", @@ -235,15 +238,23 @@ }, "description": "the baseline metadata values." } - }, - "required": [ "id", "type", "name" ], - "description": "The response to a baseline query." + }, + "description": "The baseline properties class." }, "Baseline": { "type": "object", "properties": { "sensitivity": { "type": "string", + "enum": [ + "Low", + "Medium", + "High" + ], + "x-ms-enum": { + "name": "AccountType", + "modelAsString": false + }, "description": "the sensitivity of the baseline." }, "lowThresholds": { @@ -270,12 +281,12 @@ } }, "parameters": { - "ResourceUriParameter": { + "ExtendedResourceUriParameter": { "name": "resourceUri", "in": "path", "required": true, "type": "string", - "description": "The identifier of the resource.", + "description": "The identifier of the resource. It has the following structure: subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. For example: subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1", "x-ms-parameter-location": "method", "x-ms-skip-url-encoding": true }, diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json index cf38a5f291f5..7bbb9d27b453 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json @@ -45,7 +45,7 @@ "description": "**Lists the baseline values for a resource**.", "parameters": [ { - "$ref": "#/parameters/ResourceUriParameter" + "$ref": "#/parameters/ExtendedResourceUriParameter" }, { "$ref": "#/parameters/ApiVersionParameter" @@ -192,6 +192,15 @@ "properties": { "sensitivity": { "type": "string", + "enum": [ + "Low", + "Medium", + "High" + ], + "x-ms-enum": { + "name": "AccountType", + "modelAsString": false + }, "description": "the sensitivity of the baseline." }, "lowThresholds": { @@ -218,12 +227,12 @@ } }, "parameters": { - "ResourceUriParameter": { + "ExtendedResourceUriParameter": { "name": "resourceUri", "in": "path", "required": true, "type": "string", - "description": "The identifier of the resource.", + "description": "The identifier of the resource. It has the following structure: subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. For example: subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1", "x-ms-parameter-location": "method", "x-ms-skip-url-encoding": true }, diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/CalculateBaseline.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/CalculateBaseline.json index acde031f29a4..3b1a708a6c91 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/CalculateBaseline.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/CalculateBaseline.json @@ -1,7 +1,7 @@ { "parameters": { "resourceUri": "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default", - "api-version": "2017-05-01-preview", + "api-version": "2017-11-01-preview", "TimeSeriesInformation": { "sensitivities": ["Low", "Medium"], "values": [61.0, 62.0] diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaseline.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaseline.json index 7c1614f93f25..e7b39ef4b363 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaseline.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaseline.json @@ -6,7 +6,7 @@ "aggregation": "Average", "interval": "PT1H", "sensitivities": "Low,Medium", - "api-version": "2017-11-01" + "api-version": "2017-11-01-preview" }, "responses": { "200": { @@ -19,36 +19,36 @@ "properties": { "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", "aggregation": "Average", - "interval": "PT1H" - }, - "timestamps": [ - "2017-04-14T02:20:00Z", - "2017-04-14T03:20:00Z" - ], - "baseline": [ - { - "sensitivity": "Low", - "lowThresholds": [ - 30.0, - 31.1 - ], - "highThresholds": [ - 90.3453, - 91.3453 - ] - }, - { - "sensitivity": "Medium", - "lowThresholds": [ - 50.0, - 51.1 - ], - "highThresholds": [ - 70.3453, - 71.3453 - ] - } - ] + "interval": "PT1H", + "timestamps": [ + "2017-04-14T02:20:00Z", + "2017-04-14T03:20:00Z" + ], + "baseline": [ + { + "sensitivity": "Low", + "lowThresholds": [ + 30.0, + 31.1 + ], + "highThresholds": [ + 90.3453, + 91.3453 + ] + }, + { + "sensitivity": "Medium", + "lowThresholds": [ + 50.0, + 51.1 + ], + "highThresholds": [ + 70.3453, + 71.3453 + ] + } + ] + } } } } diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaselineMetadata.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaselineMetadata.json index 50a3d92e3824..e3384a56ce4a 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaselineMetadata.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/examples/GetBaselineMetadata.json @@ -6,7 +6,7 @@ "aggregation": "Average", "interval": "PT1H", "resulttype": "metadata", - "api-version": "2017-11-01" + "api-version": "2017-11-01-preview" }, "responses": { "200": { @@ -19,18 +19,18 @@ "properties": { "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", "aggregation": "Average", - "interval": "PT1H" - }, - "metadata": [ - { - "name": "CurrentTrainingState", - "value": "Trained" - }, - { - "name": "SelectedModel", - "value": "AdjustedBoxplot" - } - ] + "interval": "PT1H", + "metadata": [ + { + "name": "CurrentTrainingState", + "value": "Trained" + }, + { + "name": "SelectedModel", + "value": "AdjustedBoxplot" + } + ] + } } } } From d644cf73bffb9cc3d3eaf93c4be8f305feb5e2fb Mon Sep 17 00:00:00 2001 From: Asaf Strassberg Date: Sun, 10 Dec 2017 18:07:02 +0200 Subject: [PATCH 3/4] Fixed Sensitivity enum name --- .../microsoft.insights/2017-11-01-preview/baseline_API.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json index 199c0f635a33..fadcfa344ccc 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/baseline_API.json @@ -252,7 +252,7 @@ "High" ], "x-ms-enum": { - "name": "AccountType", + "name": "Sensitivity", "modelAsString": false }, "description": "the sensitivity of the baseline." From 0bea039e55642d350206f6546792e0fc356bbf31 Mon Sep 17 00:00:00 2001 From: Asaf Strassberg Date: Mon, 11 Dec 2017 10:17:18 +0200 Subject: [PATCH 4/4] Fixed sensitivity enum name --- .../2017-11-01-preview/calculateBaseline_API.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json index 7bbb9d27b453..4720f7a4c3a9 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-11-01-preview/calculateBaseline_API.json @@ -198,7 +198,7 @@ "High" ], "x-ms-enum": { - "name": "AccountType", + "name": "Sensitivity", "modelAsString": false }, "description": "the sensitivity of the baseline."