From 52f3d1936bf0a7c277d702cfecfa5f2f7dc20283 Mon Sep 17 00:00:00 2001 From: Todd King <58755170+ToddKingMSFT@users.noreply.github.com> Date: Thu, 23 Mar 2023 16:34:01 -0700 Subject: [PATCH 01/26] Adds base for updating preview from version 2018-09-01-preview/examples to version 2023-03-01-preview --- .../AzureMetrics_IngestMetrics.json | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 specification/monitor/data-plane/preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json diff --git a/specification/monitor/data-plane/preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json b/specification/monitor/data-plane/preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json new file mode 100644 index 000000000000..9ac38f422824 --- /dev/null +++ b/specification/monitor/data-plane/preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "Content-Type": "application/json", + "Content-Length": 783, + "Authorization": "Bearer {AAD JWT token issued for \"https://monitoring.azure.com/\"}", + "subscriptionId": "b7ac8a0c-fbae-4e29-a0f7-09999b8857a1", + "resourceGroupName": "CowsSeller", + "resourceProvider": "Microsoft.Storage", + "resourceTypeName": "storageAccounts", + "resourceName": "cowssellerstore", + "body": { + "time": "2018-08-24T 11:02:00-7:00", + "data": { + "baseData": { + "metric": "CowsSold", + "namespace": "Cows", + "dimNames": [ + "Breed", + "Color", + "Age" + ], + "series": [ + { + "dimValues": [ + "Angus", + "Blue", + "5" + ], + "min": 5, + "max": 20, + "sum": 30, + "count": 3 + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "statusCode": 200 + } + } + } +} From a2c2851c4a033d9e346c618d01be4a389856db21 Mon Sep 17 00:00:00 2001 From: Todd King <58755170+ToddKingMSFT@users.noreply.github.com> Date: Thu, 23 Mar 2023 16:34:05 -0700 Subject: [PATCH 02/26] Updates readme --- specification/monitor/data-plane/readme.md | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/specification/monitor/data-plane/readme.md b/specification/monitor/data-plane/readme.md index befae450ba7a..8ec7a917cada 100644 --- a/specification/monitor/data-plane/readme.md +++ b/specification/monitor/data-plane/readme.md @@ -4,10 +4,10 @@ This is the AutoRest configuration file for MonitorClient. - - --- + ## Getting Started + To build the SDK for MonitorClient, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: > `autorest` @@ -15,22 +15,30 @@ To build the SDK for MonitorClient, simply [Install AutoRest](https://aka.ms/aut To see additional help and options, run: > `autorest --help` + --- ## Configuration - - ### Basic Information + These are the global settings for the MonitorClient API. ``` yaml title: MonitorClient description: Monitor Management Client openapi-type: data-plane +tag: package-preview-2023-03 +``` + -tag: package-2018-09-preview +### Tag: package-preview-2023-03 +These settings apply only when `--tag=package-preview-2023-03` is specified on the command line. + +```yaml $(tag) == 'package-preview-2023-03' +input-file: + - preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json ``` ### Tag: package-2018-09-preview @@ -44,7 +52,6 @@ input-file: # Code Generation - ## Swagger to SDK This section describes what SDK should be generated by the automatic system. @@ -55,7 +62,6 @@ swagger-to-sdk: - repo: azure-sdk-for-net-track2 ``` - ## C# These settings apply only when `--csharp` is specified on the command line. @@ -71,7 +77,6 @@ csharp: clear-output-folder: true ``` - ## Go These settings apply only when `--go` is specified on the command line. @@ -116,11 +121,13 @@ python: package-version: 0.5.0 clear-output-folder: true ``` + ``` yaml $(python) && $(python-mode) == 'update' python: no-namespace-folders: true output-folder: $(python-sdks-folder)/azure-monitor/azure/monitor ``` + ``` yaml $(python) && $(python-mode) == 'create' python: basic-setup-py: true @@ -140,7 +147,8 @@ license-header: MICROSOFT_MIT_NO_CODEGEN payload-flattening-threshold: 1 output-folder: $(azure-libraries-for-java-folder)/monitor/data-plane ``` -## Multi-API/Profile support for AutoRest v3 generators + +## Multi-API/Profile support for AutoRest v3 generators AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. @@ -156,11 +164,10 @@ input-file: ``` -If there are files that should not be in the `all-api-versions` set, +If there are files that should not be in the `all-api-versions` set, uncomment the `exclude-file` section below and add the file paths. ``` yaml $(tag) == 'all-api-versions' #exclude-file: # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ``` - From a72c5fd26849c799543155493044fc09acccb546 Mon Sep 17 00:00:00 2001 From: Todd King <58755170+ToddKingMSFT@users.noreply.github.com> Date: Thu, 23 Mar 2023 16:34:09 -0700 Subject: [PATCH 03/26] Updates API version in new specs and examples From 6c5061eaa7683eb202c37e73a55cd032f64a0fa1 Mon Sep 17 00:00:00 2001 From: Todd King Date: Tue, 28 Mar 2023 18:43:36 -0700 Subject: [PATCH 04/26] Add metricsbatch swagger --- .../2023-03-01-preview/metricBatch.json | 944 ++++++++++++++++++ .../AzureMetrics_IngestMetrics.json | 47 - specification/monitor/data-plane/readme.md | 4 +- 3 files changed, 947 insertions(+), 48 deletions(-) create mode 100644 specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json delete mode 100644 specification/monitor/data-plane/preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json new file mode 100644 index 000000000000..455d4e16a30b --- /dev/null +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -0,0 +1,944 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Azure Monitor Metric Batch", + "version": "2023-03-01-preview" + }, + "servers": [ + { + "url": "https://{region}.metrics.monitor.azure.com", + "variables": { + "region": { + "default": "eastus", + "description": "The Azure region code (westus, eastus, northeurope, etc) for all of the resourceIds specified." + } + } + } + ], + "paths": { + "/subscriptions/{subscriptionId}/metricBatch": { + "post": { + "tags": [ + "Metrics" + ], + "operationId": "Metrics_Batch", + "description": "**Lists the metric values for multiple resources**.", + "parameters": [ + { + "$ref": "#/components/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/components/parameters/TimespanParameter" + }, + { + "$ref": "#/components/parameters/IntervalParameter" + }, + { + "$ref": "#/components/parameters/MetricNamespaceParameter" + }, + { + "$ref": "#/components/parameters/MetricNamesParameter" + }, + { + "$ref": "#/components/parameters/RegionParameter" + }, + { + "$ref": "#/components/parameters/AggregationsParameter" + }, + { + "$ref": "#/components/parameters/TopParameter" + }, + { + "$ref": "#/components/parameters/OrderByParameter" + }, + { + "$ref": "#/components/parameters/FilterParameter" + }, + { + "$ref": "#/components/parameters/ApiVersionParameter" + } + ], + "requestBody": { + "description": "List of resources to query metric namespaces for", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricBatchBody" + } + } + } + }, + "responses": { + "200": { + "$ref": "#/components/responses/Response" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "components": { + "schemas": { + "MetricBatchBody": { + "description": "List of resource ids to fetch metric namespaces for", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + ] + }, + "LocalizableString": { + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "the invariant value." + }, + "localizedValue": { + "type": "string", + "description": "the locale specific value." + } + }, + "description": "The localizable string class." + }, + "Unit": { + "type": "string", + "description": "the unit of the metric.", + "enum": [ + "Count", + "Bytes", + "Seconds", + "CountPerSecond", + "BytesPerSecond", + "Percent", + "MilliSeconds", + "ByteSeconds", + "Unspecified", + "Cores", + "MilliCores", + "NanoCores", + "BitsPerSecond" + ], + "x-ms-enum": { + "name": "Unit", + "modelAsString": false + } + }, + "MetricValue": { + "required": [ + "timeStamp" + ], + "properties": { + "timeStamp": { + "type": "string", + "format": "date-time", + "description": "the timestamp for the metric value in ISO 8601 format." + }, + "average": { + "type": "number", + "format": "double", + "description": "the average value in the time range." + }, + "minimum": { + "type": "number", + "format": "double", + "description": "the least value in the time range." + }, + "maximum": { + "type": "number", + "format": "double", + "description": "the greatest value in the time range." + }, + "total": { + "type": "number", + "format": "double", + "description": "the sum of all of the values in the time range." + }, + "count": { + "type": "number", + "format": "double", + "description": "the number of samples in the time range. Can be used to determine the number of values that contributed to the average value." + } + }, + "description": "Represents a metric value." + }, + "MetadataValue": { + "properties": { + "name": { + "$ref": "#/components/schemas/LocalizableString", + "description": "the name of the metadata." + }, + "value": { + "type": "string", + "description": "the value of the metadata." + } + }, + "description": "Represents a metric metadata value." + }, + "Result": { + "description": "The metrics result for a resource.", + "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" + }, + "resourceregion": { + "type": "string", + "description": "The region of the resource been queried for metrics." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metric" + }, + "description": "the value of the collection." + } + }, + "required": [ + "timespan", + "value" + ] + }, + "Metric": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "the metric Id." + }, + "name": { + "$ref": "#/components/schemas/LocalizableString", + "description": "the name and the display name of the metric, i.e. it is localizable string." + }, + "displayDescription": { + "type": "string", + "description": "Description of this metric" + }, + "type": { + "type": "string", + "description": "the resource type of the metric resource." + }, + "unit": { + "$ref": "#/components/schemas/Unit", + "description": "the unit of the metric." + }, + "timeseries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TimeSeriesElement" + }, + "description": "the time series returned when a data query is performed." + } + }, + "required": [ + "id", + "name", + "displayDescription", + "type", + "unit", + "timeseries" + ], + "description": "The result data of a query." + }, + "TimeSeriesElement": { + "type": "object", + "properties": { + "metadatavalues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataValue" + }, + "description": "the metadata values returned if $filter was specified in the call." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetricValue" + }, + "description": "An array of data points representing the metric values. This is only returned if a result type of data is specified." + } + }, + "description": "A time series result type. The discriminator value is always TimeSeries in this case." + } + }, + "responses": { + "ErrorResponse": { + "description": "Describes the format of Error response.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, + "examples": { + "expired_token_example": { + "$ref": "#/components/examples/expired_token_example" + } + } + } + } + }, + "Response": { + "description": "The response to a metrics query.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Result" + } + }, + "examples": { + "storage": { + "$ref": "#/components/examples/storage_example" + } + } + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The subscription identifier for the resources in this batch.", + "example": "123456728-abcd-1234-abcd-123456789abc" + }, + "TimespanParameter": { + "name": "timespan", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.", + "example": "2020-08-01T20:00:00.123Z/2020-08-01T23:00:00.345Z" + }, + "IntervalParameter": { + "name": "interval", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "duration" + }, + "description": "The interval (i.e. timegrain) of the query.", + "example": "PT15M" + }, + "MetricNamespaceParameter": { + "name": "metricnamespace", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Metric namespace to query metric definitions for.", + "example": "microsoft.storage/storageaccounts" + }, + "MetricNamesParameter": { + "name": "metricnames", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "The names of the metrics (comma separated) to retrieve.", + "example": "Ingress,Egress" + }, + "AggregationsParameter": { + "name": "aggregation", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "The list of aggregation types (comma separated) to retrieve.", + "example": "average,maximum,minimum" + }, + "TopParameter": { + "name": "top", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + }, + "description": "The maximum number of records to retrieve.\nValid only if $filter is specified.\nDefaults to 10.", + "example": 10 + }, + "OrderByParameter": { + "name": "orderby", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\nExamples: sum asc.", + "example": "average desc" + }, + "FilterParameter": { + "name": "$filter", + "in": "query", + "required": false, + "schema": { + "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 ‘*’**.", + "example": "ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'" + }, + "RegionParameter": { + "name": "region", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "The Azure region code (westus, eastus, northeurope, etc) for all of the resourceIds specified. Not required if the region is in the host name.", + "example": "eastus" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Client Api Version.", + "example": "2020-08-01-preview" + } + }, + "examples": { + "storage_example": { + "summary": "Example response from a storage batch call", + "value": [ + { + "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", + "interval": "PT15M", + "value": [ + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Ingress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Ingress", + "localizedValue": "Ingress" + }, + "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T20:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T20:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T20:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T21:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T21:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T21:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T21:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T22:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T22:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T22:45:00Z", + "average": 437.542750929368, + "minimum": 437, + "maximum": 583 + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 342, + "minimum": 342, + "maximum": 342 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + }, + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Egress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Egress", + "localizedValue": "Egress" + }, + "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 796, + "minimum": 796, + "maximum": 796 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T20:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T20:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T20:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T21:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T21:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T21:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T21:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T22:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T22:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T22:45:00Z", + "average": 363.4423791821561, + "minimum": 361, + "maximum": 1018 + } + ] + } + ], + "errorCode": "Success" + } + ], + "namespace": "microsoft.storage/storageaccounts", + "resourceregion": "eastus" + }, + { + "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", + "interval": "PT15M", + "value": [ + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Ingress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Ingress", + "localizedValue": "Ingress" + }, + "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 330, + "minimum": 330, + "maximum": 330 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + }, + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Egress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Egress", + "localizedValue": "Egress" + }, + "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 880, + "minimum": 880, + "maximum": 880 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + } + ], + "namespace": "microsoft.storage/storageaccounts", + "resourceregion": "eastus" + } + ] + }, + "expired_token_example": { + "summary": "Example error response for an expired auth token", + "value": { + "code": "ExpiredAuthenticationToken", + "message": "The access token expiry UTC time '8/6/2020 8:25:30 AM' is earlier than current UTC time '8/6/2020 4:06:04 PM'." + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json b/specification/monitor/data-plane/preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json deleted file mode 100644 index 9ac38f422824..000000000000 --- a/specification/monitor/data-plane/preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parameters": { - "api-version": "2018-09-01-preview", - "Content-Type": "application/json", - "Content-Length": 783, - "Authorization": "Bearer {AAD JWT token issued for \"https://monitoring.azure.com/\"}", - "subscriptionId": "b7ac8a0c-fbae-4e29-a0f7-09999b8857a1", - "resourceGroupName": "CowsSeller", - "resourceProvider": "Microsoft.Storage", - "resourceTypeName": "storageAccounts", - "resourceName": "cowssellerstore", - "body": { - "time": "2018-08-24T 11:02:00-7:00", - "data": { - "baseData": { - "metric": "CowsSold", - "namespace": "Cows", - "dimNames": [ - "Breed", - "Color", - "Age" - ], - "series": [ - { - "dimValues": [ - "Angus", - "Blue", - "5" - ], - "min": 5, - "max": 20, - "sum": 30, - "count": 3 - } - ] - } - } - } - }, - "responses": { - "200": { - "body": { - "statusCode": 200 - } - } - } -} diff --git a/specification/monitor/data-plane/readme.md b/specification/monitor/data-plane/readme.md index 8ec7a917cada..dd5c5a910645 100644 --- a/specification/monitor/data-plane/readme.md +++ b/specification/monitor/data-plane/readme.md @@ -38,7 +38,8 @@ These settings apply only when `--tag=package-preview-2023-03` is specified on t ```yaml $(tag) == 'package-preview-2023-03' input-file: - - preview/preview/2023-03-01-preview/AzureMetrics_IngestMetrics.json + - Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json + - preview/2018-09-01-preview/metricsCreate_API.json ``` ### Tag: package-2018-09-preview @@ -161,6 +162,7 @@ require: $(this-folder)/../../../profiles/readme.md # all the input files across all versions input-file: - $(this-folder)/preview/2018-09-01-preview/metricsCreate_API.json + - $(this-folder)/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json ``` From 26a3afc0732b9a12eeddbd81026ac34693abed1e Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 30 Mar 2023 22:56:46 +0000 Subject: [PATCH 05/26] Convert dataplane swagger to openapi 2.0 --- .../examples/MetricBatchExample.json | 520 +++++++ .../2023-03-01-preview/metricBatch.json | 1191 +++++------------ 2 files changed, 847 insertions(+), 864 deletions(-) create mode 100644 specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json new file mode 100644 index 000000000000..c21f06660c0a --- /dev/null +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json @@ -0,0 +1,520 @@ +{ + "parameters": { + "baseUrl": "https://eastus.metrics.monitor.azure.com/", + "subscriptionId": "123456728-abcd-1234-abcd-123456789abc", + "timespan": "2020-08-01T20:00:00.123Z/2020-08-01T23:00:00.345Z", + "interval": "PT15M", + "metricnamespace": "Microsoft.Storage/storageAccounts", + "metricnames": "Ingress,Egress", + "aggregation": "average,minimum,maximum", + "top": 10, + "orderby": "average desc", + "$filter": "ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'", + "region": "eastus", + "api-version": "2023-03-01-preview", + "resourceIds": [ + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + ] + }, + "responses": { + "200": { + "body": [ + { + "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", + "interval": "PT15M", + "value": [ + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Ingress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Ingress", + "localizedValue": "Ingress" + }, + "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T20:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T20:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T20:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T21:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T21:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T21:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T21:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T22:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T22:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T22:45:00Z", + "average": 437.542750929368, + "minimum": 437, + "maximum": 583 + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 342, + "minimum": 342, + "maximum": 342 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + }, + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Egress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Egress", + "localizedValue": "Egress" + }, + "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 796, + "minimum": 796, + "maximum": 796 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T20:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T20:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T20:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T21:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T21:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T21:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T21:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T22:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T22:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T22:45:00Z", + "average": 363.4423791821561, + "minimum": 361, + "maximum": 1018 + } + ] + } + ], + "errorCode": "Success" + } + ], + "namespace": "microsoft.storage/storageaccounts", + "resourceregion": "eastus" + }, + { + "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", + "interval": "PT15M", + "value": [ + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Ingress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Ingress", + "localizedValue": "Ingress" + }, + "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 330, + "minimum": 330, + "maximum": 330 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + }, + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Egress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Egress", + "localizedValue": "Egress" + }, + "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 880, + "minimum": 880, + "maximum": 880 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + } + ], + "namespace": "microsoft.storage/storageaccounts", + "resourceregion": "eastus" + } + ] + }, + "default": { + "body": { + "code": "ExpiredAuthenticationToken", + "message": "The access token expiry UTC time '8/6/2020 8:25:30 AM' is earlier than current UTC time '8/6/2020 4:06:04 PM'." + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 455d4e16a30b..3b6a92594d8d 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -1,19 +1,29 @@ { - "openapi": "3.0.3", + "swagger": "2.0", "info": { "title": "Azure Monitor Metric Batch", "version": "2023-03-01-preview" }, - "servers": [ - { - "url": "https://{region}.metrics.monitor.azure.com", - "variables": { - "region": { - "default": "eastus", - "description": "The Azure region code (westus, eastus, northeurope, etc) for all of the resourceIds specified." - } + "x-ms-parameterized-host": { + "hostTemplate": "{baseUrl}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "name": "baseUrl", + "description": "The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true } - } + ] + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" ], "paths": { "/subscriptions/{subscriptionId}/metricBatch": { @@ -25,920 +35,373 @@ "description": "**Lists the metric values for multiple resources**.", "parameters": [ { - "$ref": "#/components/parameters/SubscriptionIdParameter" + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/TimespanParameter" }, { - "$ref": "#/components/parameters/TimespanParameter" + "$ref": "#/parameters/IntervalParameter" }, { - "$ref": "#/components/parameters/IntervalParameter" + "$ref": "#/parameters/MetricNamespaceParameter" }, { - "$ref": "#/components/parameters/MetricNamespaceParameter" + "$ref": "#/parameters/MetricNamesParameter" }, { - "$ref": "#/components/parameters/MetricNamesParameter" + "$ref": "#/parameters/RegionParameter" }, { - "$ref": "#/components/parameters/RegionParameter" + "$ref": "#/parameters/AggregationsParameter" }, { - "$ref": "#/components/parameters/AggregationsParameter" + "$ref": "#/parameters/TopParameter" }, { - "$ref": "#/components/parameters/TopParameter" + "$ref": "#/parameters/OrderByParameter" }, { - "$ref": "#/components/parameters/OrderByParameter" + "$ref": "#/parameters/FilterParameter" }, { - "$ref": "#/components/parameters/FilterParameter" + "$ref": "#/parameters/ApiVersionParameter" }, { - "$ref": "#/components/parameters/ApiVersionParameter" + "$ref": "#/parameters/ResourceIdList" } ], - "requestBody": { - "description": "List of resources to query metric namespaces for", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MetricBatchBody" - } - } - } - }, "responses": { "200": { - "$ref": "#/components/responses/Response" + "description": "The response to a metrics query.", + "schema": { + "$ref": "#/definitions/Response" + } }, "default": { - "$ref": "#/components/responses/ErrorResponse" + "description": "Describes the format of Error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Query Storage Metrics": { + "$ref": "./examples/MetricBatchExample.json" } } } } }, - "components": { - "schemas": { - "MetricBatchBody": { - "description": "List of resource ids to fetch metric namespaces for", - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" - ] + "parameters": { + "ResourceIdList": { + "name": "resourceIds", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ResourceIdList" }, - "LocalizableString": { - "required": [ - "value" - ], - "properties": { - "value": { - "type": "string", - "description": "the invariant value." - }, - "localizedValue": { - "type": "string", - "description": "the locale specific value." - } - }, - "description": "The localizable string class." + "description": "The comma separated list of resource IDs to query metrics for." + }, + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The subscription identifier for the resources in this batch." + }, + "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'." + }, + "IntervalParameter": { + "name": "interval", + "in": "query", + "required": false, + "type": "string", + "format": "duration", + "description": "The interval (i.e. timegrain) of the query." + }, + "MetricNamespaceParameter": { + "name": "metricnamespace", + "in": "query", + "required": true, + "type": "string", + "description": "Metric namespace to query metric definitions for." + }, + "MetricNamesParameter": { + "name": "metricnames", + "in": "query", + "required": true, + "type": "string", + "description": "The names of the metrics (comma separated) to retrieve." + }, + "AggregationsParameter": { + "name": "aggregation", + "in": "query", + "required": false, + "type": "string", + "description": "The list of aggregation types (comma separated) to retrieve." + }, + "TopParameter": { + "name": "top", + "in": "query", + "required": false, + "type": "integer", + "format": "int32", + "description": "The maximum number of records to retrieve.\nValid only if $filter is specified.\nDefaults to 10." + }, + "OrderByParameter": { + "name": "orderby", + "in": "query", + "required": false, + "type": "string", + "description": "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\nExamples: sum asc." + }, + "FilterParameter": { + "name": "$filter", + "in": "query", + "required": false, + "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 ‘*’**." + }, + "RegionParameter": { + "name": "region", + "in": "query", + "required": false, + "type": "string", + "description": "The Azure region code (westus, eastus, northeurope, etc) for all of the resourceIds specified. Not required if the region is in the host name." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + }, + "definitions": { + "ResourceIdList": { + "type": "array", + "items": { + "type": "string" }, - "Unit": { - "type": "string", - "description": "the unit of the metric.", - "enum": [ - "Count", - "Bytes", - "Seconds", - "CountPerSecond", - "BytesPerSecond", - "Percent", - "MilliSeconds", - "ByteSeconds", - "Unspecified", - "Cores", - "MilliCores", - "NanoCores", - "BitsPerSecond" - ], - "x-ms-enum": { - "name": "Unit", - "modelAsString": false + "example": [ + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + ] + }, + "ErrorResponse": { + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" } - }, - "MetricValue": { - "required": [ - "timeStamp" - ], - "properties": { - "timeStamp": { - "type": "string", - "format": "date-time", - "description": "the timestamp for the metric value in ISO 8601 format." - }, - "average": { - "type": "number", - "format": "double", - "description": "the average value in the time range." - }, - "minimum": { - "type": "number", - "format": "double", - "description": "the least value in the time range." - }, - "maximum": { - "type": "number", - "format": "double", - "description": "the greatest value in the time range." - }, - "total": { - "type": "number", - "format": "double", - "description": "the sum of all of the values in the time range." - }, - "count": { - "type": "number", - "format": "double", - "description": "the number of samples in the time range. Can be used to determine the number of values that contributed to the average value." - } + } + }, + "Response": { + "description": "The metrics result for a resource.", + "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." }, - "description": "Represents a metric value." - }, - "MetadataValue": { - "properties": { - "name": { - "$ref": "#/components/schemas/LocalizableString", - "description": "the name of the metadata." - }, - "value": { - "type": "string", - "description": "the value of the metadata." - } + "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." }, - "description": "Represents a metric metadata value." - }, - "Result": { - "description": "The metrics result for a resource.", - "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" - }, - "resourceregion": { - "type": "string", - "description": "The region of the resource been queried for metrics." - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Metric" - }, - "description": "the value of the collection." - } + "namespace": { + "type": "string", + "description": "The namespace of the metrics been queried" }, - "required": [ - "timespan", - "value" - ] - }, - "Metric": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "the metric Id." - }, - "name": { - "$ref": "#/components/schemas/LocalizableString", - "description": "the name and the display name of the metric, i.e. it is localizable string." - }, - "displayDescription": { - "type": "string", - "description": "Description of this metric" - }, - "type": { - "type": "string", - "description": "the resource type of the metric resource." - }, - "unit": { - "$ref": "#/components/schemas/Unit", - "description": "the unit of the metric." - }, - "timeseries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TimeSeriesElement" - }, - "description": "the time series returned when a data query is performed." - } + "resourceregion": { + "type": "string", + "description": "The region of the resource been queried for metrics." }, - "required": [ - "id", - "name", - "displayDescription", - "type", - "unit", - "timeseries" - ], - "description": "The result data of a query." - }, - "TimeSeriesElement": { - "type": "object", - "properties": { - "metadatavalues": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetadataValue" - }, - "description": "the metadata values returned if $filter was specified in the call." + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Metric" }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricValue" - }, - "description": "An array of data points representing the metric values. This is only returned if a result type of data is specified." - } - }, - "description": "A time series result type. The discriminator value is always TimeSeries in this case." - } - }, - "responses": { - "ErrorResponse": { - "description": "Describes the format of Error response.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string" - }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string" - } - } - }, - "examples": { - "expired_token_example": { - "$ref": "#/components/examples/expired_token_example" - } - } - } + "description": "the value of the collection." } }, - "Response": { - "description": "The response to a metrics query.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Result" - } - }, - "examples": { - "storage": { - "$ref": "#/components/examples/storage_example" - } - } - } - } - } + "required": [ + "timespan", + "value" + ] }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The subscription identifier for the resources in this batch.", - "example": "123456728-abcd-1234-abcd-123456789abc" + "MetricBatchBody": { + "description": "List of resource ids to fetch metric namespaces for", + "type": "array", + "items": { + "type": "string" }, - "TimespanParameter": { - "name": "timespan", - "in": "query", - "required": false, - "schema": { - "type": "string" + "example": [ + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + ] + }, + "LocalizableString": { + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "the invariant value." }, - "description": "The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.", - "example": "2020-08-01T20:00:00.123Z/2020-08-01T23:00:00.345Z" + "localizedValue": { + "type": "string", + "description": "the locale specific value." + } }, - "IntervalParameter": { - "name": "interval", - "in": "query", - "required": false, - "schema": { + "description": "The localizable string class." + }, + "Unit": { + "type": "string", + "description": "the unit of the metric.", + "enum": [ + "Count", + "Bytes", + "Seconds", + "CountPerSecond", + "BytesPerSecond", + "Percent", + "MilliSeconds", + "ByteSeconds", + "Unspecified", + "Cores", + "MilliCores", + "NanoCores", + "BitsPerSecond" + ], + "x-ms-enum": { + "name": "Unit", + "modelAsString": false + } + }, + "MetricValue": { + "required": [ + "timeStamp" + ], + "properties": { + "timeStamp": { "type": "string", - "format": "duration" + "format": "date-time", + "description": "the timestamp for the metric value in ISO 8601 format." }, - "description": "The interval (i.e. timegrain) of the query.", - "example": "PT15M" - }, - "MetricNamespaceParameter": { - "name": "metricnamespace", - "in": "query", - "required": true, - "schema": { - "type": "string" + "average": { + "type": "number", + "format": "double", + "description": "the average value in the time range." }, - "description": "Metric namespace to query metric definitions for.", - "example": "microsoft.storage/storageaccounts" - }, - "MetricNamesParameter": { - "name": "metricnames", - "in": "query", - "required": true, - "schema": { - "type": "string" + "minimum": { + "type": "number", + "format": "double", + "description": "the least value in the time range." }, - "description": "The names of the metrics (comma separated) to retrieve.", - "example": "Ingress,Egress" - }, - "AggregationsParameter": { - "name": "aggregation", - "in": "query", - "required": false, - "schema": { - "type": "string" + "maximum": { + "type": "number", + "format": "double", + "description": "the greatest value in the time range." }, - "description": "The list of aggregation types (comma separated) to retrieve.", - "example": "average,maximum,minimum" - }, - "TopParameter": { - "name": "top", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32" + "total": { + "type": "number", + "format": "double", + "description": "the sum of all of the values in the time range." }, - "description": "The maximum number of records to retrieve.\nValid only if $filter is specified.\nDefaults to 10.", - "example": 10 + "count": { + "type": "number", + "format": "double", + "description": "the number of samples in the time range. Can be used to determine the number of values that contributed to the average value." + } }, - "OrderByParameter": { - "name": "orderby", - "in": "query", - "required": false, - "schema": { - "type": "string" + "description": "Represents a metric value." + }, + "MetadataValue": { + "properties": { + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "the name of the metadata." }, - "description": "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\nExamples: sum asc.", - "example": "average desc" + "value": { + "type": "string", + "description": "the value of the metadata." + } }, - "FilterParameter": { - "name": "$filter", - "in": "query", - "required": false, - "schema": { - "type": "string" + "description": "Represents a metric metadata value." + }, + "Metric": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "the metric Id." }, - "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 ‘*’**.", - "example": "ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'" - }, - "RegionParameter": { - "name": "region", - "in": "query", - "required": false, - "schema": { - "type": "string" + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "the name and the display name of the metric, i.e. it is localizable string." }, - "description": "The Azure region code (westus, eastus, northeurope, etc) for all of the resourceIds specified. Not required if the region is in the host name.", - "example": "eastus" - }, - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "schema": { - "type": "string" + "displayDescription": { + "type": "string", + "description": "Description of this metric" }, - "description": "Client Api Version.", - "example": "2020-08-01-preview" - } - }, - "examples": { - "storage_example": { - "summary": "Example response from a storage batch call", - "value": [ - { - "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", - "interval": "PT15M", - "value": [ - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Ingress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Ingress", - "localizedValue": "Ingress" - }, - "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlob" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "SAS" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T20:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T20:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T20:45:00Z", - "average": 437.54477611940297, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T21:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T21:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T21:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T21:45:00Z", - "average": 437.54477611940297, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T22:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T22:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T22:45:00Z", - "average": 437.542750929368, - "minimum": 437, - "maximum": 583 - } - ] - }, - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 342, - "minimum": 342, - "maximum": 342 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" - }, - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Egress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Egress", - "localizedValue": "Egress" - }, - "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 796, - "minimum": 796, - "maximum": 796 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - }, - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlob" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "SAS" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T20:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T20:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T20:45:00Z", - "average": 363.4514925373134, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T21:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T21:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T21:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T21:45:00Z", - "average": 363.4514925373134, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T22:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T22:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T22:45:00Z", - "average": 363.4423791821561, - "minimum": 361, - "maximum": 1018 - } - ] - } - ], - "errorCode": "Success" - } - ], - "namespace": "microsoft.storage/storageaccounts", - "resourceregion": "eastus" + "type": { + "type": "string", + "description": "the resource type of the metric resource." + }, + "unit": { + "$ref": "#/definitions/Unit", + "description": "the unit of the metric." + }, + "timeseries": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeSeriesElement" }, - { - "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", - "interval": "PT15M", - "value": [ - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Ingress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Ingress", - "localizedValue": "Ingress" - }, - "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 330, - "minimum": 330, - "maximum": 330 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" - }, - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Egress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Egress", - "localizedValue": "Egress" - }, - "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 880, - "minimum": 880, - "maximum": 880 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" - } - ], - "namespace": "microsoft.storage/storageaccounts", - "resourceregion": "eastus" - } - ] + "description": "the time series returned when a data query is performed." + } }, - "expired_token_example": { - "summary": "Example error response for an expired auth token", - "value": { - "code": "ExpiredAuthenticationToken", - "message": "The access token expiry UTC time '8/6/2020 8:25:30 AM' is earlier than current UTC time '8/6/2020 4:06:04 PM'." + "required": [ + "id", + "name", + "displayDescription", + "type", + "unit", + "timeseries" + ], + "description": "The result data of a query." + }, + "TimeSeriesElement": { + "type": "object", + "properties": { + "metadatavalues": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataValue" + }, + "description": "the metadata values returned if $filter was specified in the call." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricValue" + }, + "description": "An array of data points representing the metric values. This is only returned if a result type of data is specified." } - } + }, + "description": "A time series result type. The discriminator value is always TimeSeries in this case." } } } \ No newline at end of file From c9420d4f1521705e482ba367dd4f0507d4cd011d Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 30 Mar 2023 23:42:58 +0000 Subject: [PATCH 06/26] Fix response type --- .../2023-03-01-preview/metricBatch.json | 63 ++++++++++--------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 3b6a92594d8d..2419431dedfd 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -209,37 +209,40 @@ }, "Response": { "description": "The metrics result for a resource.", - "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" - }, - "resourceregion": { - "type": "string", - "description": "The region of the resource been queried for metrics." - }, - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/Metric" + "type": "array", + "items": { + "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." }, - "description": "the value of the collection." - } - }, - "required": [ - "timespan", - "value" - ] + "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" + }, + "resourceregion": { + "type": "string", + "description": "The region of the resource been queried for metrics." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Metric" + }, + "description": "the value of the collection." + } + }, + "required": [ + "timespan", + "value" + ] + } }, "MetricBatchBody": { "description": "List of resource ids to fetch metric namespaces for", From 736b6550c36d3419320ddfb45c8c3abd65be80c8 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 30 Mar 2023 23:54:28 +0000 Subject: [PATCH 07/26] Update response schema --- .../preview/2023-03-01-preview/metricBatch.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 2419431dedfd..d2d77824e2f3 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -374,6 +374,14 @@ "$ref": "#/definitions/TimeSeriesElement" }, "description": "the time series returned when a data query is performed." + }, + "errorCode": { + "type": "string", + "description": "'Success' or the error details on query failures for this metric." + }, + "errorMessage": { + "type": "string", + "description": "Error message encountered querying this specific metric." } }, "required": [ From 17f4f3aa88b53879d83c8e7d7a420e39c1ef28b5 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Fri, 31 Mar 2023 01:16:13 +0000 Subject: [PATCH 08/26] Lint fixes --- .../2023-03-01-preview/metricBatch.json | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index d2d77824e2f3..94079061d0a6 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -62,10 +62,11 @@ "$ref": "#/parameters/OrderByParameter" }, { - "$ref": "#/parameters/FilterParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" + "name": "$filter", + "in": "query", + "required": false, + "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 ‘*’**.", }, { "$ref": "#/parameters/ResourceIdList" @@ -108,14 +109,16 @@ "in": "path", "required": true, "type": "string", - "description": "The subscription identifier for the resources in this batch." + "description": "The subscription identifier for the resources in this batch.", + "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'." + "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", @@ -123,28 +126,32 @@ "required": false, "type": "string", "format": "duration", - "description": "The interval (i.e. timegrain) of the query." + "description": "The interval (i.e. timegrain) of the query.", + "x-ms-parameter-location": "method" }, "MetricNamespaceParameter": { "name": "metricnamespace", "in": "query", "required": true, "type": "string", - "description": "Metric namespace to query metric definitions for." + "description": "Metric namespace to query metric definitions for.", + "x-ms-parameter-location": "method" }, "MetricNamesParameter": { "name": "metricnames", "in": "query", "required": true, "type": "string", - "description": "The names of the metrics (comma separated) to retrieve." + "description": "The names of the metrics (comma separated) to retrieve.", + "x-ms-parameter-location": "method" }, "AggregationsParameter": { "name": "aggregation", "in": "query", "required": false, "type": "string", - "description": "The list of aggregation types (comma separated) to retrieve." + "description": "The list of aggregation types (comma separated) to retrieve.", + "x-ms-parameter-location": "method" }, "TopParameter": { "name": "top", @@ -152,39 +159,29 @@ "required": false, "type": "integer", "format": "int32", - "description": "The maximum number of records to retrieve.\nValid only if $filter is specified.\nDefaults to 10." + "description": "The maximum number of records to retrieve.\nValid only if $filter is specified.\nDefaults to 10.", + "x-ms-parameter-location": "method" }, "OrderByParameter": { "name": "orderby", "in": "query", "required": false, "type": "string", - "description": "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\nExamples: sum asc." - }, - "FilterParameter": { - "name": "$filter", - "in": "query", - "required": false, - "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 ‘*’**." + "description": "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\nExamples: sum asc.", + "x-ms-parameter-location": "method" }, "RegionParameter": { "name": "region", "in": "query", "required": false, "type": "string", - "description": "The Azure region code (westus, eastus, northeurope, etc) for all of the resourceIds specified. Not required if the region is in the host name." - }, - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Client Api Version." + "description": "The Azure region code (westus, eastus, northeurope, etc) for all of the resourceIds specified. Not required if the region is in the host name.", + "x-ms-parameter-location": "method" } }, "definitions": { "ResourceIdList": { + "description": "The comma separated list of resource IDs to query metrics for.", "type": "array", "items": { "type": "string" @@ -195,6 +192,7 @@ ] }, "ErrorResponse": { + "description": "Describes the format of Error response.", "type": "object", "properties": { "code": { @@ -256,6 +254,7 @@ ] }, "LocalizableString": { + "type": "object", "required": [ "value" ], @@ -295,6 +294,7 @@ } }, "MetricValue": { + "type": "object", "required": [ "timeStamp" ], @@ -333,6 +333,7 @@ "description": "Represents a metric value." }, "MetadataValue": { + "type": "object", "properties": { "name": { "$ref": "#/definitions/LocalizableString", From cf4f4f68f92e5fe993f5bab9cbcbeaf57818caac Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Fri, 31 Mar 2023 01:21:39 +0000 Subject: [PATCH 09/26] Unexpected token fix --- .../preview/2023-03-01-preview/metricBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 94079061d0a6..bc285946734d 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -66,7 +66,7 @@ "in": "query", "required": false, "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 ‘*’**.", + "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 ‘*’**." }, { "$ref": "#/parameters/ResourceIdList" From 7a8148c69c427049da7eef1a47d90111d5c2fc78 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Fri, 31 Mar 2023 01:40:43 +0000 Subject: [PATCH 10/26] Prettier --- .../examples/MetricBatchExample.json | 1022 ++++++++--------- .../2023-03-01-preview/metricBatch.json | 2 +- 2 files changed, 512 insertions(+), 512 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json index c21f06660c0a..11c374fc3264 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json @@ -1,520 +1,520 @@ { - "parameters": { - "baseUrl": "https://eastus.metrics.monitor.azure.com/", - "subscriptionId": "123456728-abcd-1234-abcd-123456789abc", - "timespan": "2020-08-01T20:00:00.123Z/2020-08-01T23:00:00.345Z", - "interval": "PT15M", - "metricnamespace": "Microsoft.Storage/storageAccounts", - "metricnames": "Ingress,Egress", - "aggregation": "average,minimum,maximum", - "top": 10, - "orderby": "average desc", - "$filter": "ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'", - "region": "eastus", - "api-version": "2023-03-01-preview", - "resourceIds": [ - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" - ] - }, - "responses": { - "200": { - "body": [ + "parameters": { + "baseUrl": "https://eastus.metrics.monitor.azure.com/", + "subscriptionId": "123456728-abcd-1234-abcd-123456789abc", + "timespan": "2020-08-01T20:00:00.123Z/2020-08-01T23:00:00.345Z", + "interval": "PT15M", + "metricnamespace": "Microsoft.Storage/storageAccounts", + "metricnames": "Ingress,Egress", + "aggregation": "average,minimum,maximum", + "top": 10, + "orderby": "average desc", + "$filter": "ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'", + "region": "eastus", + "api-version": "2023-03-01-preview", + "resourceIds": [ + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + ] + }, + "responses": { + "200": { + "body": [ + { + "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", + "interval": "PT15M", + "value": [ + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Ingress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Ingress", + "localizedValue": "Ingress" + }, + "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T20:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T20:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T20:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T21:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T21:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T21:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T21:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T22:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T22:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T22:45:00Z", + "average": 437.542750929368, + "minimum": 437, + "maximum": 583 + } + ] + }, { - "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", - "interval": "PT15M", - "value": [ - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Ingress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Ingress", - "localizedValue": "Ingress" - }, - "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlob" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "SAS" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T20:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T20:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T20:45:00Z", - "average": 437.54477611940297, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T21:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T21:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T21:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T21:45:00Z", - "average": 437.54477611940297, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T22:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T22:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T22:45:00Z", - "average": 437.542750929368, - "minimum": 437, - "maximum": 583 - } - ] - }, - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 342, - "minimum": 342, - "maximum": 342 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" - }, - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Egress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Egress", - "localizedValue": "Egress" - }, - "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 796, - "minimum": 796, - "maximum": 796 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - }, - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlob" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "SAS" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T20:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T20:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T20:45:00Z", - "average": 363.4514925373134, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T21:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T21:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T21:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T21:45:00Z", - "average": 363.4514925373134, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T22:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T22:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T22:45:00Z", - "average": 363.4423791821561, - "minimum": 361, - "maximum": 1018 - } - ] - } - ], - "errorCode": "Success" - } - ], - "namespace": "microsoft.storage/storageaccounts", - "resourceregion": "eastus" + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 342, + "minimum": 342, + "maximum": 342 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + }, + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Egress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Egress", + "localizedValue": "Egress" + }, + "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 796, + "minimum": 796, + "maximum": 796 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] }, { - "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", - "interval": "PT15M", - "value": [ - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Ingress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Ingress", - "localizedValue": "Ingress" - }, - "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 330, - "minimum": 330, - "maximum": 330 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" - }, - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Egress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Egress", - "localizedValue": "Egress" - }, - "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 880, - "minimum": 880, - "maximum": 880 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" - } - ], - "namespace": "microsoft.storage/storageaccounts", - "resourceregion": "eastus" + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T20:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T20:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T20:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T21:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T21:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T21:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T21:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T22:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T22:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T22:45:00Z", + "average": 363.4423791821561, + "minimum": 361, + "maximum": 1018 + } + ] } - ] + ], + "errorCode": "Success" + } + ], + "namespace": "microsoft.storage/storageaccounts", + "resourceregion": "eastus" }, - "default": { - "body": { - "code": "ExpiredAuthenticationToken", - "message": "The access token expiry UTC time '8/6/2020 8:25:30 AM' is earlier than current UTC time '8/6/2020 4:06:04 PM'." + { + "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", + "interval": "PT15M", + "value": [ + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Ingress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Ingress", + "localizedValue": "Ingress" + }, + "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 330, + "minimum": 330, + "maximum": 330 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + }, + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Egress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Egress", + "localizedValue": "Egress" + }, + "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 880, + "minimum": 880, + "maximum": 880 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" } + ], + "namespace": "microsoft.storage/storageaccounts", + "resourceregion": "eastus" } + ] + }, + "default": { + "body": { + "code": "ExpiredAuthenticationToken", + "message": "The access token expiry UTC time '8/6/2020 8:25:30 AM' is earlier than current UTC time '8/6/2020 4:06:04 PM'." + } } -} \ No newline at end of file + } +} diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index bc285946734d..412d62a4e1ce 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -416,4 +416,4 @@ "description": "A time series result type. The discriminator value is always TimeSeries in this case." } } -} \ No newline at end of file +} From cd3f7f349e3a8b5ec72fca5c924c01a6eca3f65e Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Fri, 31 Mar 2023 18:39:44 +0000 Subject: [PATCH 11/26] PR comments --- .../examples/MetricBatchExample.json | 23 +++++++- .../2023-03-01-preview/metricBatch.json | 56 ++++++++++++++----- 2 files changed, 63 insertions(+), 16 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json index 11c374fc3264..a7a0a86d6673 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json @@ -10,7 +10,6 @@ "top": 10, "orderby": "average desc", "$filter": "ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'", - "region": "eastus", "api-version": "2023-03-01-preview", "resourceIds": [ "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", @@ -354,7 +353,8 @@ } ], "namespace": "microsoft.storage/storageaccounts", - "resourceregion": "eastus" + "resourceregion": "eastus", + "resourceid": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1" }, { "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", @@ -506,10 +506,27 @@ } ], "namespace": "microsoft.storage/storageaccounts", - "resourceregion": "eastus" + "resourceregion": "eastus", + "resourceid": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" } ] }, + "400": { + "body": { + "additionalInfo": [ + { + "type": "string", + "info": "TraceId={00000000-0000-0000-0000-000000000000}" + }, + { + "type": "string", + "info": "ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException" + } + ], + "code": "BadRequest", + "message": "Query endTime: 06/06/2021 00:00:00 is out of the Max metrics retention period: 93.00:00:00, traceId: {00000000-0000-0000-0000-000000000000}" + } + }, "default": { "body": { "code": "ExpiredAuthenticationToken", diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 412d62a4e1ce..41b959d5335e 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -49,9 +49,6 @@ { "$ref": "#/parameters/MetricNamesParameter" }, - { - "$ref": "#/parameters/RegionParameter" - }, { "$ref": "#/parameters/AggregationsParameter" }, @@ -79,6 +76,12 @@ "$ref": "#/definitions/Response" } }, + "400": { + "description": "The response to a metrics query that results in a bad request, with optional additional information.", + "schema": { + "$ref": "#/definitions/AdditionalInfoErrorResponse" + } + }, "default": { "description": "Describes the format of Error response.", "schema": { @@ -117,7 +120,7 @@ "in": "query", "required": false, "type": "string", - "description": "The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.", + "description": "The timespan of the query. It is a string in the following format 'startDateTime_ISO/endDateTime_ISO'.", "x-ms-parameter-location": "method" }, "IntervalParameter": { @@ -134,7 +137,7 @@ "in": "query", "required": true, "type": "string", - "description": "Metric namespace to query metric definitions for.", + "description": "Metric namespace that contains the requested metric names.", "x-ms-parameter-location": "method" }, "MetricNamesParameter": { @@ -169,14 +172,6 @@ "type": "string", "description": "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\nExamples: sum asc.", "x-ms-parameter-location": "method" - }, - "RegionParameter": { - "name": "region", - "in": "query", - "required": false, - "type": "string", - "description": "The Azure region code (westus, eastus, northeurope, etc) for all of the resourceIds specified. Not required if the region is in the host name.", - "x-ms-parameter-location": "method" } }, "definitions": { @@ -205,6 +200,37 @@ } } }, + "AdditionalInfoErrorResponse": { + "description": "The response to a metrics query that results in a bad request, with optional additional information.", + "type": "object", + "properties": { + "additionalInfo": { + "description": "Additional information about the error", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "description": "The type of the info property (e.g. string).", + "type": "string" + }, + "info": { + "description": "Additional information related to the error.", + "type": "string" + } + } + } + }, + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, "Response": { "description": "The metrics result for a resource.", "type": "array", @@ -228,6 +254,10 @@ "type": "string", "description": "The region of the resource been queried for metrics." }, + "resourceid": { + "type": "string", + "description": "The resource that has been queried for metrics." + }, "value": { "type": "array", "items": { From 4c17b52a4195d057ad97fef07771fc2c672d49ba Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Fri, 31 Mar 2023 18:42:39 +0000 Subject: [PATCH 12/26] Comments --- .../preview/2023-03-01-preview/metricBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 41b959d5335e..3707cb7eacfe 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -129,7 +129,7 @@ "required": false, "type": "string", "format": "duration", - "description": "The interval (i.e. timegrain) of the query.", + "description": "The interval (i.e. timegrain) of the query. The default value is PT1M.", "x-ms-parameter-location": "method" }, "MetricNamespaceParameter": { From c665e04bc943ed41d386859b2733a9f9df052409 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Fri, 31 Mar 2023 19:00:55 +0000 Subject: [PATCH 13/26] Add resourceid to custom words --- custom-words.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/custom-words.txt b/custom-words.txt index 4dacc0ce562b..84905990bc7d 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -1803,6 +1803,7 @@ resourcegraph resourcegroup resourcegroups resourcehealth +resourceid resourcename resourceregion resourcetype From 7db137f6fa15775abb6c6d8a33de067fa5a9c94c Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:59:54 +0000 Subject: [PATCH 14/26] More PR comments --- .../examples/MetricBatchExample.json | 8 +- .../2023-03-01-preview/metricBatch.json | 112 ++++++++++++------ 2 files changed, 75 insertions(+), 45 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json index a7a0a86d6673..51ea337b2d08 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json @@ -511,7 +511,7 @@ } ] }, - "400": { + "default": { "body": { "additionalInfo": [ { @@ -526,12 +526,6 @@ "code": "BadRequest", "message": "Query endTime: 06/06/2021 00:00:00 is out of the Max metrics retention period: 93.00:00:00, traceId: {00000000-0000-0000-0000-000000000000}" } - }, - "default": { - "body": { - "code": "ExpiredAuthenticationToken", - "message": "The access token expiry UTC time '8/6/2020 8:25:30 AM' is earlier than current UTC time '8/6/2020 4:06:04 PM'." - } } } } diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 3707cb7eacfe..72927af06d80 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -65,6 +65,9 @@ "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 ‘*’**." }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, { "$ref": "#/parameters/ResourceIdList" } @@ -76,16 +79,10 @@ "$ref": "#/definitions/Response" } }, - "400": { - "description": "The response to a metrics query that results in a bad request, with optional additional information.", - "schema": { - "$ref": "#/definitions/AdditionalInfoErrorResponse" - } - }, "default": { "description": "Describes the format of Error response.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/AdditionalInfoErrorResponse" } } }, @@ -129,7 +126,8 @@ "required": false, "type": "string", "format": "duration", - "description": "The interval (i.e. timegrain) of the query. The default value is PT1M.", + "default": "PT1M", + "description": "The interval (i.e. timegrain) of the query.", "x-ms-parameter-location": "method" }, "MetricNamespaceParameter": { @@ -172,31 +170,26 @@ "type": "string", "description": "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\nExamples: sum asc.", "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version.", + "x-ms-parameter-location": "client" } }, "definitions": { "ResourceIdList": { "description": "The comma separated list of resource IDs to query metrics for.", - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" - ] - }, - "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" + "body": { + "type": "array", + "items": { + "type": "string" + } } } }, @@ -272,17 +265,6 @@ ] } }, - "MetricBatchBody": { - "description": "List of resource ids to fetch metric namespaces for", - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" - ] - }, "LocalizableString": { "type": "object", "required": [ @@ -320,7 +302,61 @@ ], "x-ms-enum": { "name": "Unit", - "modelAsString": false + "modelAsString": false, + "values": [ + { + "value": "Count", + "description": "Unit of raw quantity." + }, + { + "value": "Bytes", + "description": "Unit of memory in bytes." + }, + { + "value": "Seconds", + "description": "Unit of time in seconds." + }, + { + "value": "CountPerSecond", + "description": "Rate unit of raw quantity per second." + }, + { + "value": "BytesPerSecond", + "description": "Rate unit of memory in bytes per second." + }, + { + "value": "Percent", + "description": "Percentage unit." + }, + { + "value": "MilliSeconds", + "description": "Unit of time in 1/1000th of a second." + }, + { + "value": "ByteSeconds", + "description": "Unit of data transfer or storage. It is the size of the data in bytes multiplied by the time it takes to transfer or store the data in seconds." + }, + { + "value": "Unspecified", + "description": "No specified unit." + }, + { + "value": "Cores", + "description": "Unit of processing power." + }, + { + "value": "MilliCores", + "description": "Unit of processing power in 1/1000th of a CPU core." + }, + { + "value": "NanoCores", + "description": "Unit of processing power in one billionth of a CPU core." + }, + { + "value": "BitsPerSecond", + "description": "Rate unit of binary digits per second." + } + ] } }, "MetricValue": { From 19b767727dd6c64bde394095ede2d0ece39016c6 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Mon, 3 Apr 2023 19:15:15 +0000 Subject: [PATCH 15/26] Fix model --- .../preview/2023-03-01-preview/metricBatch.json | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 72927af06d80..d645cf380ab7 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -183,15 +183,14 @@ "definitions": { "ResourceIdList": { "description": "The comma separated list of resource IDs to query metrics for.", - "type": "object", - "properties": { - "body": { - "type": "array", - "items": { - "type": "string" - } - } - } + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + ] }, "AdditionalInfoErrorResponse": { "description": "The response to a metrics query that results in a bad request, with optional additional information.", From f97ce15bf2d64ecaab2d20b888a2143eacfe14f9 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Mon, 3 Apr 2023 19:50:55 +0000 Subject: [PATCH 16/26] PR comment --- .../preview/2023-03-01-preview/metricBatch.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index d645cf380ab7..f9be51a5d910 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -76,7 +76,7 @@ "200": { "description": "The response to a metrics query.", "schema": { - "$ref": "#/definitions/Response" + "$ref": "#/definitions/MetricResultsResponse" } }, "default": { @@ -223,7 +223,7 @@ } } }, - "Response": { + "MetricResultsResponse": { "description": "The metrics result for a resource.", "type": "array", "items": { From fdb875d1165589f3622d7cea6451ae49d5eb85fe Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Tue, 4 Apr 2023 17:08:27 +0000 Subject: [PATCH 17/26] Small fix to example request --- .../preview/2023-03-01-preview/examples/MetricBatchExample.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json index 51ea337b2d08..04b05869fa07 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json @@ -1,6 +1,6 @@ { "parameters": { - "baseUrl": "https://eastus.metrics.monitor.azure.com/", + "baseUrl": "https://eastus.metrics.monitor.azure.com", "subscriptionId": "123456728-abcd-1234-abcd-123456789abc", "timespan": "2020-08-01T20:00:00.123Z/2020-08-01T23:00:00.345Z", "interval": "PT15M", From 5ead06f84aa79dbff98c18188afeae3e4d3844d2 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Wed, 5 Apr 2023 23:26:01 +0000 Subject: [PATCH 18/26] Address feedback from review --- .../examples/MetricBatchExample.json | 1013 +++++++++-------- .../2023-03-01-preview/metricBatch.json | 172 +-- 2 files changed, 611 insertions(+), 574 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json index 04b05869fa07..4a3cfc7d4872 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/examples/MetricBatchExample.json @@ -9,522 +9,531 @@ "aggregation": "average,minimum,maximum", "top": 10, "orderby": "average desc", - "$filter": "ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'", + "filter": "ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'", "api-version": "2023-03-01-preview", - "resourceIds": [ - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" - ] + "resourceIds": { + "resourceids": [ + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + ] + } }, "responses": { "200": { - "body": [ - { - "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", - "interval": "PT15M", - "value": [ - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Ingress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Ingress", - "localizedValue": "Ingress" + "body": { + "values": [ + { + "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", + "interval": "PT15M", + "value": [ + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Ingress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Ingress", + "localizedValue": "Ingress" + }, + "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T20:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T20:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T20:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T21:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T21:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T21:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T21:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T22:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2020-08-01T22:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2020-08-01T22:45:00Z", + "average": 437.542750929368, + "minimum": 437, + "maximum": 583 + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 342, + "minimum": 342, + "maximum": 342 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" }, - "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlob" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "SAS" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T20:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T20:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T20:45:00Z", - "average": 437.54477611940297, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T21:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T21:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T21:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T21:45:00Z", - "average": 437.54477611940297, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T22:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2020-08-01T22:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2020-08-01T22:45:00Z", - "average": 437.542750929368, - "minimum": 437, - "maximum": 583 - } - ] + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Egress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Egress", + "localizedValue": "Egress" }, - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 342, - "minimum": 342, - "maximum": 342 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" - }, - { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Egress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Egress", - "localizedValue": "Egress" + "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 796, + "minimum": 796, + "maximum": 796 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T20:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T20:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T20:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T21:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T21:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T21:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T21:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T22:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2020-08-01T22:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2020-08-01T22:45:00Z", + "average": 363.4423791821561, + "minimum": 361, + "maximum": 1018 + } + ] + } + ], + "errorCode": "Success" + } + ], + "namespace": "microsoft.storage/storageaccounts", + "resourceregion": "eastus", + "resourceid": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1" + }, + { + "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", + "interval": "PT15M", + "value": [ + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Ingress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Ingress", + "localizedValue": "Ingress" + }, + "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 330, + "minimum": 330, + "maximum": 330 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" }, - "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 796, - "minimum": 796, - "maximum": 796 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] + { + "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Egress", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "Egress", + "localizedValue": "Egress" }, - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlob" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "SAS" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T20:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T20:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T20:45:00Z", - "average": 363.4514925373134, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T21:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T21:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T21:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T21:45:00Z", - "average": 363.4514925373134, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T22:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2020-08-01T22:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2020-08-01T22:45:00Z", - "average": 363.4423791821561, - "minimum": 361, - "maximum": 1018 - } - ] - } - ], - "errorCode": "Success" - } - ], - "namespace": "microsoft.storage/storageaccounts", - "resourceregion": "eastus", - "resourceid": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1" - }, - { - "timespan": "2020-08-01T20:00:00Z/2020-08-01T23:00:00Z", - "interval": "PT15M", - "value": [ + "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlobServiceProperties" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "AccountKey" + } + ], + "data": [ + { + "timeStamp": "2020-08-01T20:00:00Z" + }, + { + "timeStamp": "2020-08-01T20:15:00Z" + }, + { + "timeStamp": "2020-08-01T20:30:00Z" + }, + { + "timeStamp": "2020-08-01T20:45:00Z" + }, + { + "timeStamp": "2020-08-01T21:00:00Z" + }, + { + "timeStamp": "2020-08-01T21:15:00Z" + }, + { + "timeStamp": "2020-08-01T21:30:00Z" + }, + { + "timeStamp": "2020-08-01T21:45:00Z" + }, + { + "timeStamp": "2020-08-01T22:00:00Z", + "average": 880, + "minimum": 880, + "maximum": 880 + }, + { + "timeStamp": "2020-08-01T22:15:00Z" + }, + { + "timeStamp": "2020-08-01T22:30:00Z" + }, + { + "timeStamp": "2020-08-01T22:45:00Z" + } + ] + } + ], + "errorCode": "Success" + } + ], + "namespace": "microsoft.storage/storageaccounts", + "resourceregion": "eastus", + "resourceid": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + } + ] + } + }, + "default": { + "headers": { + "x-ms-error-code": "BadRequest" + }, + "body": { + "error": { + "additionalInfo": [ { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Ingress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Ingress", - "localizedValue": "Ingress" - }, - "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 330, - "minimum": 330, - "maximum": 330 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" + "type": "string", + "info": "TraceId={00000000-0000-0000-0000-000000000000}" }, { - "id": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Egress", - "type": "Microsoft.Insights/metrics", - "name": { - "value": "Egress", - "localizedValue": "Egress" - }, - "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.", - "unit": "Bytes", - "timeseries": [ - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlobServiceProperties" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "AccountKey" - } - ], - "data": [ - { - "timeStamp": "2020-08-01T20:00:00Z" - }, - { - "timeStamp": "2020-08-01T20:15:00Z" - }, - { - "timeStamp": "2020-08-01T20:30:00Z" - }, - { - "timeStamp": "2020-08-01T20:45:00Z" - }, - { - "timeStamp": "2020-08-01T21:00:00Z" - }, - { - "timeStamp": "2020-08-01T21:15:00Z" - }, - { - "timeStamp": "2020-08-01T21:30:00Z" - }, - { - "timeStamp": "2020-08-01T21:45:00Z" - }, - { - "timeStamp": "2020-08-01T22:00:00Z", - "average": 880, - "minimum": 880, - "maximum": 880 - }, - { - "timeStamp": "2020-08-01T22:15:00Z" - }, - { - "timeStamp": "2020-08-01T22:30:00Z" - }, - { - "timeStamp": "2020-08-01T22:45:00Z" - } - ] - } - ], - "errorCode": "Success" + "type": "string", + "info": "ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException" } ], - "namespace": "microsoft.storage/storageaccounts", - "resourceregion": "eastus", - "resourceid": "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + "code": "BadRequest", + "message": "Query endTime: 06/06/2021 00:00:00 is out of the Max metrics retention period: 93.00:00:00, traceId: {00000000-0000-0000-0000-000000000000}" } - ] - }, - "default": { - "body": { - "additionalInfo": [ - { - "type": "string", - "info": "TraceId={00000000-0000-0000-0000-000000000000}" - }, - { - "type": "string", - "info": "ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException" - } - ], - "code": "BadRequest", - "message": "Query endTime: 06/06/2021 00:00:00 is out of the Max metrics retention period: 93.00:00:00, traceId: {00000000-0000-0000-0000-000000000000}" } } } diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index f9be51a5d910..a0898c937ea4 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -26,13 +26,13 @@ "application/json" ], "paths": { - "/subscriptions/{subscriptionId}/metricBatch": { + "/subscriptions/{subscriptionId}/metrics:getBatchMetrics": { "post": { "tags": [ "Metrics" ], "operationId": "Metrics_Batch", - "description": "**Lists the metric values for multiple resources**.", + "description": "Lists the metric values for multiple resources.", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" @@ -59,11 +59,7 @@ "$ref": "#/parameters/OrderByParameter" }, { - "name": "$filter", - "in": "query", - "required": false, - "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 ‘*’**." + "$ref": "#/parameters/FilterParameter" }, { "$ref": "#/parameters/ApiVersionParameter" @@ -81,6 +77,12 @@ }, "default": { "description": "Describes the format of Error response.", + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "Error code for specific error that occurred." + } + }, "schema": { "$ref": "#/definitions/AdditionalInfoErrorResponse" } @@ -160,7 +162,7 @@ "required": false, "type": "integer", "format": "int32", - "description": "The maximum number of records to retrieve.\nValid only if $filter is specified.\nDefaults to 10.", + "description": "The maximum number of records to retrieve.\nValid only if filter is specified.\nDefaults to 10.", "x-ms-parameter-location": "method" }, "OrderByParameter": { @@ -171,6 +173,14 @@ "description": "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\nExamples: sum asc.", "x-ms-parameter-location": "method" }, + "FilterParameter": { + "name": "filter", + "in": "query", + "required": false, + "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 ‘*’**.", + "x-ms-parameter-location": "method" + }, "ApiVersionParameter": { "name": "api-version", "in": "query", @@ -183,85 +193,103 @@ "definitions": { "ResourceIdList": { "description": "The comma separated list of resource IDs to query metrics for.", - "type": "array", - "items": { - "type": "string" + "type": "object", + "properties": { + "resourceids": { + "type": "array", + "items": { + "type": "string" + } + } }, - "example": [ - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", - "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" - ] + "example": { + "resourceids": [ + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1", + "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2" + ] + } }, "AdditionalInfoErrorResponse": { "description": "The response to a metrics query that results in a bad request, with optional additional information.", "type": "object", "properties": { - "additionalInfo": { - "description": "Additional information about the error", - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "description": "The type of the info property (e.g. string).", - "type": "string" - }, - "info": { - "description": "Additional information related to the error.", - "type": "string" + "error": { + "description": "Top level error object that contains all relevant information.", + "type": "object", + "properties": { + "additionalInfo": { + "description": "Additional information about the error", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "description": "The type of the info property (e.g. string).", + "type": "string" + }, + "info": { + "description": "Additional information related to the error.", + "type": "string" + } + } } + }, + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" } } - }, - "code": { - "description": "Error code", - "type": "string" - }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string" } } }, "MetricResultsResponse": { "description": "The metrics result for a resource.", - "type": "array", - "items": { - "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" - }, - "resourceregion": { - "type": "string", - "description": "The region of the resource been queried for metrics." - }, - "resourceid": { - "type": "string", - "description": "The resource that has been queried for metrics." - }, - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/Metric" + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "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" + }, + "resourceregion": { + "type": "string", + "description": "The region of the resource been queried for metrics." + }, + "resourceid": { + "type": "string", + "description": "The resource that has been queried for metrics." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Metric" + }, + "description": "the value of the collection." + } }, - "description": "the value of the collection." + "required": [ + "timespan", + "value" + ] } - }, - "required": [ - "timespan", - "value" - ] + } } }, "LocalizableString": { @@ -468,7 +496,7 @@ "items": { "$ref": "#/definitions/MetadataValue" }, - "description": "the metadata values returned if $filter was specified in the call." + "description": "the metadata values returned if filter was specified in the call." }, "data": { "type": "array", From 1c0147e42440530dee5b3bf7bf66a196debf48de Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 6 Apr 2023 00:21:28 +0000 Subject: [PATCH 19/26] Update custom words --- custom-words.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/custom-words.txt b/custom-words.txt index 84905990bc7d..852008b9eb1b 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -1804,6 +1804,7 @@ resourcegroup resourcegroups resourcehealth resourceid +resourceids resourcename resourceregion resourcetype From b921f5eb5ece55f611204b89b3f2d1676a3c1dc7 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 6 Apr 2023 00:25:34 +0000 Subject: [PATCH 20/26] Small fix --- .../preview/2023-03-01-preview/metricBatch.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index a0898c937ea4..e6f9f47ace1a 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -309,7 +309,7 @@ }, "description": "The localizable string class." }, - "Unit": { + "MetricUnit": { "type": "string", "description": "the unit of the metric.", "enum": [ @@ -328,7 +328,7 @@ "BitsPerSecond" ], "x-ms-enum": { - "name": "Unit", + "name": "MetricUnit", "modelAsString": false, "values": [ { @@ -459,7 +459,7 @@ "description": "the resource type of the metric resource." }, "unit": { - "$ref": "#/definitions/Unit", + "$ref": "#/definitions/MetricUnit", "description": "the unit of the metric." }, "timeseries": { From 7ae04a981efc6a5d0dc1811cf4fd6d215b6f6f03 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 6 Apr 2023 00:27:46 +0000 Subject: [PATCH 21/26] Change descriptions for localizable string --- .../preview/2023-03-01-preview/metricBatch.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index e6f9f47ace1a..a509516df4e6 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -300,11 +300,11 @@ "properties": { "value": { "type": "string", - "description": "the invariant value." + "description": "The invariant value." }, "localizedValue": { "type": "string", - "description": "the locale specific value." + "description": "The display name." } }, "description": "The localizable string class." From 57f41f1bac8567f621acb42740fbf386b23bed24 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 6 Apr 2023 17:22:48 +0000 Subject: [PATCH 22/26] Add missing description --- .../preview/2023-03-01-preview/metricBatch.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index a509516df4e6..1575df667a48 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -196,6 +196,7 @@ "type": "object", "properties": { "resourceids": { + "description": "The list of resource IDs to query metrics for.", "type": "array", "items": { "type": "string" From 2926afb9daa7e18f797b222806273dc790220255 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 6 Apr 2023 18:11:35 +0000 Subject: [PATCH 23/26] More feedback changes --- .../preview/2023-03-01-preview/metricBatch.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 1575df667a48..1a3d587f6dd3 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -144,7 +144,11 @@ "name": "metricnames", "in": "query", "required": true, - "type": "string", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", "description": "The names of the metrics (comma separated) to retrieve.", "x-ms-parameter-location": "method" }, @@ -199,7 +203,8 @@ "description": "The list of resource IDs to query metrics for.", "type": "array", "items": { - "type": "string" + "type": "string", + "format": "arm-id" } } }, From 6161baf9463d13c9c08f5ea1577267632cdf8f55 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Thu, 6 Apr 2023 22:54:07 +0000 Subject: [PATCH 24/26] Small grammar fixes --- .../2023-03-01-preview/metricBatch.json | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 1a3d587f6dd3..0c54485caa73 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -257,6 +257,7 @@ "type": "object", "properties": { "values": { + "description": "The collection of metric data responses per resource, per metric.", "type": "array", "items": { "type": "object", @@ -287,7 +288,7 @@ "items": { "$ref": "#/definitions/Metric" }, - "description": "the value of the collection." + "description": "The value of the collection." } }, "required": [ @@ -317,7 +318,7 @@ }, "MetricUnit": { "type": "string", - "description": "the unit of the metric.", + "description": "The unit of the metric.", "enum": [ "Count", "Bytes", @@ -401,32 +402,32 @@ "timeStamp": { "type": "string", "format": "date-time", - "description": "the timestamp for the metric value in ISO 8601 format." + "description": "The timestamp for the metric value in ISO 8601 format." }, "average": { "type": "number", "format": "double", - "description": "the average value in the time range." + "description": "The average value in the time range." }, "minimum": { "type": "number", "format": "double", - "description": "the least value in the time range." + "description": "The least value in the time range." }, "maximum": { "type": "number", "format": "double", - "description": "the greatest value in the time range." + "description": "The greatest value in the time range." }, "total": { "type": "number", "format": "double", - "description": "the sum of all of the values in the time range." + "description": "The sum of all of the values in the time range." }, "count": { "type": "number", "format": "double", - "description": "the number of samples in the time range. Can be used to determine the number of values that contributed to the average value." + "description": "The number of samples in the time range. Can be used to determine the number of values that contributed to the average value." } }, "description": "Represents a metric value." @@ -436,11 +437,11 @@ "properties": { "name": { "$ref": "#/definitions/LocalizableString", - "description": "the name of the metadata." + "description": "The name of the metadata." }, "value": { "type": "string", - "description": "the value of the metadata." + "description": "The value of the metadata." } }, "description": "Represents a metric metadata value." @@ -450,11 +451,11 @@ "properties": { "id": { "type": "string", - "description": "the metric Id." + "description": "The metric Id." }, "name": { "$ref": "#/definitions/LocalizableString", - "description": "the name and the display name of the metric, i.e. it is localizable string." + "description": "The name and the display name of the metric, i.e. it is localizable string." }, "displayDescription": { "type": "string", @@ -462,18 +463,18 @@ }, "type": { "type": "string", - "description": "the resource type of the metric resource." + "description": "The resource type of the metric resource." }, "unit": { "$ref": "#/definitions/MetricUnit", - "description": "the unit of the metric." + "description": "The unit of the metric." }, "timeseries": { "type": "array", "items": { "$ref": "#/definitions/TimeSeriesElement" }, - "description": "the time series returned when a data query is performed." + "description": "The time series returned when a data query is performed." }, "errorCode": { "type": "string", @@ -502,7 +503,7 @@ "items": { "$ref": "#/definitions/MetadataValue" }, - "description": "the metadata values returned if filter was specified in the call." + "description": "The metadata values returned if filter was specified in the call." }, "data": { "type": "array", From 6c1336ded445f126ba5f49367903b10d45fff820 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Fri, 7 Apr 2023 17:45:17 +0000 Subject: [PATCH 25/26] Update endpoint name --- .../preview/2023-03-01-preview/metricBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 0c54485caa73..063603058e49 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -26,7 +26,7 @@ "application/json" ], "paths": { - "/subscriptions/{subscriptionId}/metrics:getBatchMetrics": { + "/subscriptions/{subscriptionId}/metrics:getBatch": { "post": { "tags": [ "Metrics" From 6b48edefde518595c8362cdf838f518bbf49d1a0 Mon Sep 17 00:00:00 2001 From: gulopesd <73562152+gulopesd@users.noreply.github.com> Date: Wed, 12 Apr 2023 22:36:22 +0000 Subject: [PATCH 26/26] Update interval description --- .../preview/2023-03-01-preview/metricBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json index 063603058e49..bea99195482e 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-03-01-preview/metricBatch.json @@ -269,7 +269,7 @@ "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." + "description": "The interval (window size) for which the metric data was returned in. Follows the IS8601/RFC3339 duration format (e.g. 'P1D' for 1 day). 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",