From 28e76c9367ff6cfd277cf7bb22a0b8e8e676784b Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:32:14 -0700 Subject: [PATCH 01/16] update swagger --- .../examples/MetricBatchExample.json | 543 +++++++++++++++++ .../2023-11-01-preview/metricBatch.json | 562 ++++++++++++++++++ 2 files changed, 1105 insertions(+) create mode 100644 specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/examples/MetricBatchExample.json create mode 100644 specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/examples/MetricBatchExample.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/examples/MetricBatchExample.json new file mode 100644 index 000000000000..ccdb2c2ffdc4 --- /dev/null +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/examples/MetricBatchExample.json @@ -0,0 +1,543 @@ +{ + "parameters": { + "baseUrl": "https://eastus.metrics.monitor.azure.com", + "subscriptionId": "123456728-abcd-1234-abcd-123456789abc", + "starttime": "2023-02-01T20:00:00.123Z", + "endtime": "2023-02-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 '*'", + "api-version": "2023-05-01-preview", + "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": { + "values": [ + { + "starttime": "2023-02-01T20:00:00.123Z", + "endtime": "2023-02-01T23:00:00.345Z", + "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": "2023-02-01T20:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2023-02-01T20:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2023-02-01T20:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2023-02-01T20:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2023-02-01T21:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2023-02-01T21:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2023-02-01T21:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2023-02-01T21:45:00Z", + "average": 437.54477611940297, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2023-02-01T22:00:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2023-02-01T22:15:00Z", + "average": 438.0735294117647, + "minimum": 437, + "maximum": 583 + }, + { + "timeStamp": "2023-02-01T22:30:00Z", + "average": 437, + "minimum": 437, + "maximum": 437 + }, + { + "timeStamp": "2023-02-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": "2023-02-01T20:00:00Z" + }, + { + "timeStamp": "2023-02-01T20:15:00Z" + }, + { + "timeStamp": "2023-02-01T20:30:00Z" + }, + { + "timeStamp": "2023-02-01T20:45:00Z" + }, + { + "timeStamp": "2023-02-01T21:00:00Z" + }, + { + "timeStamp": "2023-02-01T21:15:00Z" + }, + { + "timeStamp": "2023-02-01T21:30:00Z" + }, + { + "timeStamp": "2023-02-01T21:45:00Z" + }, + { + "timeStamp": "2023-02-01T22:00:00Z", + "average": 342, + "minimum": 342, + "maximum": 342 + }, + { + "timeStamp": "2023-02-01T22:15:00Z" + }, + { + "timeStamp": "2023-02-01T22:30:00Z" + }, + { + "timeStamp": "2023-02-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": "2023-02-01T20:00:00Z" + }, + { + "timeStamp": "2023-02-01T20:15:00Z" + }, + { + "timeStamp": "2023-02-01T20:30:00Z" + }, + { + "timeStamp": "2023-02-01T20:45:00Z" + }, + { + "timeStamp": "2023-02-01T21:00:00Z" + }, + { + "timeStamp": "2023-02-01T21:15:00Z" + }, + { + "timeStamp": "2023-02-01T21:30:00Z" + }, + { + "timeStamp": "2023-02-01T21:45:00Z" + }, + { + "timeStamp": "2023-02-01T22:00:00Z", + "average": 796, + "minimum": 796, + "maximum": 796 + }, + { + "timeStamp": "2023-02-01T22:15:00Z" + }, + { + "timeStamp": "2023-02-01T22:30:00Z" + }, + { + "timeStamp": "2023-02-01T22:45:00Z" + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "apiname", + "localizedValue": "apiname" + }, + "value": "GetBlob" + }, + { + "name": { + "value": "authentication", + "localizedValue": "authentication" + }, + "value": "SAS" + } + ], + "data": [ + { + "timeStamp": "2023-02-01T20:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2023-02-01T20:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2023-02-01T20:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2023-02-01T20:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2023-02-01T21:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2023-02-01T21:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2023-02-01T21:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2023-02-01T21:45:00Z", + "average": 363.4514925373134, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2023-02-01T22:00:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2023-02-01T22:15:00Z", + "average": 365.83088235294116, + "minimum": 361, + "maximum": 1018 + }, + { + "timeStamp": "2023-02-01T22:30:00Z", + "average": 361, + "minimum": 361, + "maximum": 361 + }, + { + "timeStamp": "2023-02-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" + }, + { + "starttime": "2023-02-01T20:00:00.123Z", + "endtime": "2023-02-01T23:00:00.345Z", + "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": "2023-02-01T20:00:00Z" + }, + { + "timeStamp": "2023-02-01T20:15:00Z" + }, + { + "timeStamp": "2023-02-01T20:30:00Z" + }, + { + "timeStamp": "2023-02-01T20:45:00Z" + }, + { + "timeStamp": "2023-02-01T21:00:00Z" + }, + { + "timeStamp": "2023-02-01T21:15:00Z" + }, + { + "timeStamp": "2023-02-01T21:30:00Z" + }, + { + "timeStamp": "2023-02-01T21:45:00Z" + }, + { + "timeStamp": "2023-02-01T22:00:00Z", + "average": 330, + "minimum": 330, + "maximum": 330 + }, + { + "timeStamp": "2023-02-01T22:15:00Z" + }, + { + "timeStamp": "2023-02-01T22:30:00Z" + }, + { + "timeStamp": "2023-02-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": "2023-02-01T20:00:00Z" + }, + { + "timeStamp": "2023-02-01T20:15:00Z" + }, + { + "timeStamp": "2023-02-01T20:30:00Z" + }, + { + "timeStamp": "2023-02-01T20:45:00Z" + }, + { + "timeStamp": "2023-02-01T21:00:00Z" + }, + { + "timeStamp": "2023-02-01T21:15:00Z" + }, + { + "timeStamp": "2023-02-01T21:30:00Z" + }, + { + "timeStamp": "2023-02-01T21:45:00Z" + }, + { + "timeStamp": "2023-02-01T22:00:00Z", + "average": 880, + "minimum": 880, + "maximum": 880 + }, + { + "timeStamp": "2023-02-01T22:15:00Z" + }, + { + "timeStamp": "2023-02-01T22:30:00Z" + }, + { + "timeStamp": "2023-02-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": [ + { + "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-11-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json new file mode 100644 index 000000000000..ca7cf7187c39 --- /dev/null +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json @@ -0,0 +1,562 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Monitor Metric Batch", + "version": "2023-05-01-preview" + }, + "securityDefinitions": { + "AADToken": { + "type": "oauth2", + "tokenUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/token", + "flow": "application", + "description": "Azure Active Directory OAuth2 Authentication", + "scopes": { + "https://metrics.monitor.azure.com/.default": "https://metrics.monitor.azure.com/.default" + } + } + }, + "security": [ + { + "AADToken": [ + "https://metrics.monitor.azure.com/.default" + ] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "name": "endpoint", + "description": "The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources. For global resources, the region should be 'global'.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client", + "format": "url" + } + ] + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/metrics:getBatch": { + "post": { + "tags": [ + "Metrics" + ], + "operationId": "MetricsBatch_Batch", + "description": "Lists the metric values for multiple resources.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/StartTimeParameter" + }, + { + "$ref": "#/parameters/EndTimeParameter" + }, + { + "$ref": "#/parameters/IntervalParameter" + }, + { + "$ref": "#/parameters/MetricNamespaceParameter" + }, + { + "$ref": "#/parameters/MetricNamesParameter" + }, + { + "$ref": "#/parameters/AggregationsParameter" + }, + { + "$ref": "#/parameters/TopParameter" + }, + { + "$ref": "#/parameters/OrderByParameter" + }, + { + "$ref": "#/parameters/FilterParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ResourceIdList" + } + ], + "responses": { + "200": { + "description": "The response to a metrics query.", + "schema": { + "$ref": "#/definitions/MetricResultsResponse" + } + }, + "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" + } + } + }, + "x-ms-examples": { + "Query Storage Metrics": { + "$ref": "./examples/MetricBatchExample.json" + } + } + } + } + }, + "parameters": { + "ResourceIdList": { + "name": "resourceIds", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ResourceIdList" + }, + "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.", + "x-ms-parameter-location": "method" + }, + "StartTimeParameter": { + "name": "startTime", + "in": "query", + "required": false, + "type": "string", + "description": "The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required.\nIf only starttime is specified, then endtime defaults to the current time.\nIf no time interval is specified, the default is 1 hour.", + "x-ms-parameter-location": "method" + }, + "EndTimeParameter": { + "name": "endTime", + "in": "query", + "required": false, + "type": "string", + "description": "The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.", + "x-ms-parameter-location": "method" + }, + "IntervalParameter": { + "name": "interval", + "in": "query", + "required": false, + "type": "string", + "format": "duration", + "default": "PT1M", + "description": "The interval (i.e. timegrain) of the query.\n*Examples: PT15M, PT1H, P1D*", + "x-ms-parameter-location": "method" + }, + "MetricNamespaceParameter": { + "name": "metricnamespace", + "in": "query", + "required": true, + "type": "string", + "description": "Metric namespace that contains the requested metric names.", + "x-ms-parameter-location": "method" + }, + "MetricNamesParameter": { + "name": "metricnames", + "in": "query", + "required": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "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.\n*Examples: average, minimum, maximum*", + "x-ms-parameter-location": "method" + }, + "TopParameter": { + "name": "top", + "in": "query", + "required": false, + "type": "integer", + "format": "int32", + "description": "The maximum number of records to retrieve per resource ID in the request.\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.\n*Examples: 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", + "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": "object", + "properties": { + "resourceids": { + "description": "The list of resource IDs to query metrics for.", + "type": "array", + "items": { + "type": "string", + "format": "arm-id" + } + } + }, + "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": { + "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" + } + }, + "required": [ + "code", + "message" + ] + } + }, + "required": [ + "error" + ] + }, + "MetricResultsResponse": { + "description": "The metrics result for a resource.", + "type": "object", + "properties": { + "values": { + "description": "The collection of metric data responses per resource, per metric.", + "type": "array", + "items": { + "type": "object", + "properties": { + "starttime": { + "type": "string", + "description": "The start time, in datetime format, for which the data was retrieved." + }, + "endtime": { + "type": "string", + "description": "The end time, in datetime format, for which the data was retrieved." + }, + "interval": { + "type": "string", + "format": "duration", + "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", + "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/QueryBatchMetric" + }, + "description": "The value of the collection." + } + }, + "required": [ + "starttime", + "endtime", + "value" + ] + } + } + } + }, + "QueryBatchLocalizableString": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "The invariant value." + }, + "localizedValue": { + "type": "string", + "description": "The display name." + } + }, + "description": "The localizable string class." + }, + "QueryBatchMetricUnit": { + "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": "QueryBatchMetricUnit", + "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." + } + ] + } + }, + "QueryBatchMetricValue": { + "type": "object", + "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." + }, + "QueryBatchMetadataValue": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/QueryBatchLocalizableString", + "description": "The name of the metadata." + }, + "value": { + "type": "string", + "description": "The value of the metadata." + } + }, + "description": "Represents a metric metadata value." + }, + "QueryBatchMetric": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The metric Id." + }, + "name": { + "$ref": "#/definitions/QueryBatchLocalizableString", + "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": "#/definitions/QueryBatchMetricUnit", + "description": "The unit of the metric." + }, + "timeseries": { + "type": "array", + "items": { + "$ref": "#/definitions/QueryBatchTimeSeriesElement" + }, + "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": [ + "id", + "name", + "displayDescription", + "type", + "unit", + "timeseries" + ], + "description": "The result data of a query." + }, + "QueryBatchTimeSeriesElement": { + "type": "object", + "properties": { + "metadatavalues": { + "type": "array", + "items": { + "$ref": "#/definitions/QueryBatchMetadataValue" + }, + "description": "The metadata values returned if filter was specified in the call." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/QueryBatchMetricValue" + }, + "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 77ff8aac950218b5a9dd632f2dce85c4b18ad6bb Mon Sep 17 00:00:00 2001 From: gracewilcox Date: Fri, 20 Oct 2023 15:25:13 -0700 Subject: [PATCH 02/16] batch update --- .../2023-11-01-preview/commonDefinitions.json | 80 ++++++++++++ .../2023-11-01-preview/metricBatch.json | 114 +----------------- 2 files changed, 83 insertions(+), 111 deletions(-) create mode 100644 specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json new file mode 100644 index 000000000000..fd3705c9aa81 --- /dev/null +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json @@ -0,0 +1,80 @@ +{ + "swagger": "2.0", + "info": { + "version": "2023-10-01", + "title": "Common Monitoring types" + }, + "paths": {}, + "definitions": { + "LocalizableString": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "The invariant value." + }, + "localizedValue": { + "type": "string", + "description": "The display name." + } + }, + "description": "The localizable string class." + }, + "MetricValue": { + "type": "object", + "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": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "The name of the metadata." + }, + "value": { + "type": "string", + "description": "The value of the metadata." + } + }, + "description": "Represents a metric metadata value." + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json index ca7cf7187c39..b0086fbd9c6c 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json @@ -342,100 +342,6 @@ } } }, - "QueryBatchLocalizableString": { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "string", - "description": "The invariant value." - }, - "localizedValue": { - "type": "string", - "description": "The display name." - } - }, - "description": "The localizable string class." - }, - "QueryBatchMetricUnit": { - "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": "QueryBatchMetricUnit", - "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." - } - ] - } - }, "QueryBatchMetricValue": { "type": "object", "required": [ @@ -475,20 +381,6 @@ }, "description": "Represents a metric value." }, - "QueryBatchMetadataValue": { - "type": "object", - "properties": { - "name": { - "$ref": "#/definitions/QueryBatchLocalizableString", - "description": "The name of the metadata." - }, - "value": { - "type": "string", - "description": "The value of the metadata." - } - }, - "description": "Represents a metric metadata value." - }, "QueryBatchMetric": { "type": "object", "properties": { @@ -497,7 +389,7 @@ "description": "The metric Id." }, "name": { - "$ref": "#/definitions/QueryBatchLocalizableString", + "$ref": "./commonDefinitions.json#/definitions/LocalizableString", "description": "The name and the display name of the metric, i.e. it is localizable string." }, "displayDescription": { @@ -544,14 +436,14 @@ "metadatavalues": { "type": "array", "items": { - "$ref": "#/definitions/QueryBatchMetadataValue" + "$ref": "./commonDefinitions.json#/definitions/MetadataValue" }, "description": "The metadata values returned if filter was specified in the call." }, "data": { "type": "array", "items": { - "$ref": "#/definitions/QueryBatchMetricValue" + "$ref": "./commonDefinitions.json#/definitions/MetricValue" }, "description": "An array of data points representing the metric values. This is only returned if a result type of data is specified." } From 121ef2b08c7b6db8fe368bc7652933ed6dc1bcd4 Mon Sep 17 00:00:00 2001 From: gracewilcox Date: Fri, 20 Oct 2023 15:43:56 -0700 Subject: [PATCH 03/16] update old swagger --- .../metricsDefinitions_API.json | 273 +++++++++++++++ .../2023-11-01-preview/metrics_API.json | 320 ++++++++++++++++++ 2 files changed, 593 insertions(+) create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metricsDefinitions_API.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metricsDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metricsDefinitions_API.json new file mode 100644 index 000000000000..347257717169 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metricsDefinitions_API.json @@ -0,0 +1,273 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorManagementClient", + "version": "2018-01-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/{resourceUri}/providers/Microsoft.Insights/metricDefinitions": { + "get": { + "tags": [ + "MetricDefinitions" + ], + "operationId": "MetricDefinitions_List", + "description": "Lists the metric definitions for the resource.", + "parameters": [ + { + "$ref": "#/parameters/ResourceUriParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/MetricNamespaceParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to get the list of metric definitions", + "schema": { + "$ref": "#/definitions/MetricDefinitionCollection" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "Get Metric Definitions without filter": { + "$ref": "./examples/GetMetricDefinitions.json" + }, + "Get Application Insights Metric Definitions without filter": { + "$ref": "./examples/GetMetricDefinitionsApplicationInsights.json" + }, + "Get StorageCache Metric Definitions with metric class": { + "$ref": "./examples/GetMetricDefinitionsMetricClass.json" + } + } + } + } + }, + "definitions": { + "MetricAvailability": { + "type": "object", + "properties": { + "timeGrain": { + "type": "string", + "format": "duration", + "description": "the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc." + }, + "retention": { + "type": "string", + "format": "duration", + "description": "the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc." + } + }, + "description": "Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain." + }, + "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": "MetricUnit", + "modelAsString": true + } + }, + "AggregationType": { + "type": "string", + "description": "the aggregation type of the metric.", + "enum": [ + "None", + "Average", + "Count", + "Minimum", + "Maximum", + "Total" + ], + "x-ms-enum": { + "name": "AggregationType", + "modelAsString": false + } + }, + "MetricClass": { + "type": "string", + "description": "The class of the metric.", + "enum": [ + "Availability", + "Transactions", + "Errors", + "Latency", + "Saturation" + ], + "x-ms-enum": { + "name": "MetricClass", + "modelAsString": true + } + }, + "MetricDefinition": { + "type": "object", + "properties": { + "isDimensionRequired": { + "type": "boolean", + "description": "Flag to indicate whether the dimension is required." + }, + "resourceId": { + "type": "string", + "description": "the resource identifier of the resource that emitted the metric." + }, + "namespace": { + "type": "string", + "description": "the namespace the metric belongs to." + }, + "name": { + "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/LocalizableString", + "description": "the name and the display name of the metric, i.e. it is a localizable string." + }, + "displayDescription": { + "type": "string", + "description": "Detailed description of this metric." + }, + "category": { + "type": "string", + "description": "Custom category name for this metric." + }, + "metricClass": { + "$ref": "#/definitions/MetricClass", + "description": "The class of the metric." + }, + "unit": { + "$ref": "#/definitions/Unit", + "description": "The unit of the metric." + }, + "primaryAggregationType": { + "$ref": "#/definitions/AggregationType", + "description": "the primary aggregation type value defining how to use the values for display." + }, + "supportedAggregationTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationType" + }, + "description": "the collection of what aggregation types are supported." + }, + "metricAvailabilities": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricAvailability" + }, + "description": "the collection of what aggregation intervals are available to be queried." + }, + "id": { + "type": "string", + "description": "the resource identifier of the metric definition." + }, + "dimensions": { + "type": "array", + "items": { + "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/LocalizableString" + }, + "description": "the name and the display name of the dimension, i.e. it is a localizable string." + } + }, + "description": "Metric definition class specifies the metadata for a metric." + }, + "MetricDefinitionCollection": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricDefinition" + }, + "description": "the values for the metric definitions." + } + }, + "required": [ + "value" + ], + "description": "Represents collection of metric definitions." + }, + "ErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + } + }, + "parameters": { + "ResourceUriParameter": { + "name": "resourceUri", + "in": "path", + "required": true, + "type": "string", + "description": "The identifier of the resource.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "MetricNamespaceParameter": { + "name": "metricnamespace", + "in": "query", + "required": false, + "type": "string", + "description": "Metric namespace to query metric definitions for.", + "x-ms-parameter-location": "method" + } + } + } \ No newline at end of file diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json new file mode 100644 index 000000000000..79cb0a27841a --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json @@ -0,0 +1,320 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorManagementClient", + "version": "2018-01-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/{resourceUri}/providers/Microsoft.Insights/metrics": { + "get": { + "tags": [ + "Metrics" + ], + "operationId": "Metrics_List", + "description": "**Lists the metric values for a resource**.", + "parameters": [ + { + "$ref": "#/parameters/ResourceUriParameter" + }, + { + "$ref": "#/parameters/TimespanParameter" + }, + { + "$ref": "#/parameters/IntervalParameter" + }, + { + "$ref": "#/parameters/MetricNamesParameter" + }, + { + "$ref": "#/parameters/AggregationsParameter" + }, + { + "$ref": "#/parameters/TopParameter" + }, + { + "$ref": "#/parameters/OrderByParameter" + }, + { + "name": "$filter", + "in": "query", + "type": "string", + "description": "The **$filter** is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= \"dim (test) 1 eq '*' \" use **$filter= \"dim %2528test%2529 1 eq '*' \"** When dimension name is **dim (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= \"dim (test) 3 eq 'dim3 (test) val' \" use **$filter= \"dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' \"**", + "required": false + }, + { + "$ref": "#/parameters/ResultTypeParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/MetricNamespaceParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to get the list of metric values.", + "schema": { + "$ref": "#/definitions/Response" + } + } + }, + "x-ms-odata": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/MetaDataValue", + "x-ms-examples": { + "Get Metric for data": { + "$ref": "./examples/GetMetric.json" + }, + "Get Metric for metadata": { + "$ref": "./examples/GetMetricMetadata.json" + }, + "Get Metric with error": { + "$ref": "./examples/GetMetricError.json" + } + } + } + } + }, + "definitions": { + "Response": { + "type": "object", + "properties": { + "cost": { + "type": "number", + "format": "int32", + "minimum": 0, + "description": "The integer value representing the relative cost of the query." + }, + "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 being queried" + }, + "resourceregion": { + "type": "string", + "description": "The region of the resource being queried for metrics." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Metric" + }, + "description": "the value of the collection." + } + }, + "required": [ + "timespan", + "value" + ], + "description": "The response to a metrics query." + }, + "Metric": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "the metric Id." + }, + "type": { + "type": "string", + "description": "the resource type of the metric resource." + }, + "name": { + "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/LocalizableString", + "description": "the name and the display name of the metric, i.e. it is localizable string." + }, + "displayDescription": { + "type": "string", + "description": "Detailed description of this metric." + }, + "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." + }, + "unit": { + "$ref": "#/definitions/Unit", + "description": "The unit of the metric." + }, + "timeseries": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeSeriesElement" + }, + "description": "the time series returned when a data query is performed." + } + }, + "required": [ + "id", + "type", + "name", + "unit", + "timeseries" + ], + "description": "The result data of a query." + }, + "TimeSeriesElement": { + "type": "object", + "properties": { + "metadatavalues": { + "type": "array", + "items": { + "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/MetadataValue" + }, + "description": "the metadata values returned if $filter was specified in the call." + }, + "data": { + "type": "array", + "items": { + "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/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." + }, + "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" + } + } + } + }, + "parameters": { + "ResourceUriParameter": { + "name": "resourceUri", + "in": "path", + "required": true, + "type": "string", + "description": "The identifier of the resource.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "TimespanParameter": { + "name": "timespan", + "in": "query", + "required": false, + "type": "string", + "description": "The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.", + "x-ms-parameter-location": "method" + }, + "IntervalParameter": { + "name": "interval", + "in": "query", + "required": false, + "type": "string", + "format": "duration", + "description": "The interval (i.e. timegrain) of the query.", + "x-ms-parameter-location": "method" + }, + "MetricNamesParameter": { + "name": "metricnames", + "in": "query", + "required": false, + "type": "string", + "description": "The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**", + "x-ms-parameter-location": "method" + }, + "AggregationsParameter": { + "name": "aggregation", + "in": "query", + "required": false, + "type": "string", + "description": "The list of aggregation types (comma separated) to retrieve.", + "x-ms-parameter-location": "method" + }, + "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.", + "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.", + "x-ms-parameter-location": "method" + }, + "ResultTypeParameter": { + "name": "resultType", + "in": "query", + "type": "string", + "enum": [ + "Data", + "Metadata" + ], + "x-ms-enum": { + "name": "ResultType", + "modelAsString": false + }, + "description": "Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details.", + "x-ms-parameter-location": "method", + "required": false + }, + "MetricNamespaceParameter": { + "name": "metricnamespace", + "in": "query", + "required": false, + "type": "string", + "description": "Metric namespace to query metric definitions for.", + "x-ms-parameter-location": "method" + } + } + } \ No newline at end of file From 68400973b272bc4fcbf0587d332a41446a2e7abb Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:46:45 -0700 Subject: [PATCH 04/16] Update metricBatch.json --- .../preview/2023-11-01-preview/metricBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json index b0086fbd9c6c..fd32d51753c6 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json @@ -401,7 +401,7 @@ "description": "The resource type of the metric resource." }, "unit": { - "$ref": "#/definitions/QueryBatchMetricUnit", + "$ref": "#/definitions/MetricUnit", "description": "The unit of the metric." }, "timeseries": { From 2dbdb57b6de7b6c40a3419074599ee9b4d9b3d96 Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:52:57 -0700 Subject: [PATCH 05/16] Update metricBatch.json --- .../2023-11-01-preview/metricBatch.json | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json index fd32d51753c6..64a8e9e53774 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json @@ -401,7 +401,7 @@ "description": "The resource type of the metric resource." }, "unit": { - "$ref": "#/definitions/MetricUnit", + "$ref": "#/definitions/QueryBatchMetricUnit", "description": "The unit of the metric." }, "timeseries": { @@ -449,6 +449,83 @@ } }, "description": "A time series result type. The discriminator value is always TimeSeries in this case." + }, + "QueryBatchMetricUnit": { + "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": "QueryBatchMetricUnit", + "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." + } + ] + } } } } \ No newline at end of file From 4458b8db2bbec26e906a981d804583393165b26e Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:55:44 -0700 Subject: [PATCH 06/16] Update metrics_API.json --- .../2023-11-01-preview/metrics_API.json | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json index 79cb0a27841a..d6c96a8434d2 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json @@ -315,6 +315,29 @@ "type": "string", "description": "Metric namespace to query metric definitions for.", "x-ms-parameter-location": "method" + }, + "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": "MetricUnit", + "modelAsString": true + } } } } \ No newline at end of file From 55e6934c6583f5d5db1465e23f02e0a47e033f5a Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:40:02 -0700 Subject: [PATCH 07/16] wip --- specification/monitor/commonDefinitions.json | 178 ++++++ .../2023-05-01-preview/metricBatch.json | 218 +------ .../2023-11-01-preview/commonDefinitions.json | 80 --- .../examples/MetricBatchExample.json | 543 ------------------ .../2023-11-01-preview/metricBatch.json | 531 ----------------- .../metricsDefinitions_API.json | 273 --------- .../2023-11-01-preview/metrics_API.json | 343 ----------- .../2018-01-01/metricDefinitions_API.json | 45 +- .../stable/2018-01-01/metrics_API.json | 171 +----- 9 files changed, 184 insertions(+), 2198 deletions(-) create mode 100644 specification/monitor/commonDefinitions.json delete mode 100644 specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json delete mode 100644 specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/examples/MetricBatchExample.json delete mode 100644 specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json delete mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metricsDefinitions_API.json delete mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json diff --git a/specification/monitor/commonDefinitions.json b/specification/monitor/commonDefinitions.json new file mode 100644 index 000000000000..17b44b244cc9 --- /dev/null +++ b/specification/monitor/commonDefinitions.json @@ -0,0 +1,178 @@ +{ + "swagger": "2.0", + "info": { + "version": "2023-11-01", + "title": "Common Monitoring types" + }, + "paths": {}, + "definitions": { + "LocalizableString": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "The invariant value." + }, + "localizedValue": { + "type": "string", + "description": "The display name." + } + }, + "description": "The localizable string class." + }, + "MetricValue": { + "type": "object", + "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": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "The name of the metadata." + }, + "value": { + "type": "string", + "description": "The value of the metadata." + } + }, + "description": "Represents a metric metadata value." + }, + "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": "MetricUnit", + "modelAsString": true + } + }, + "TimeSeriesElement": { + "type": "object", + "properties": { + "metadatavalues": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataValue" + }, + "x-ms-identifiers": [ + "name" + ], + "description": "the metadata values returned if $filter was specified in the call." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricValue" + }, + "x-ms-identifiers": [ + "timeStamp" + ], + "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." + }, + "Metric": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "the metric Id." + }, + "type": { + "type": "string", + "description": "the resource type of the metric resource." + }, + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "the name and the display name of the metric, i.e. it is localizable string." + }, + "displayDescription": { + "type": "string", + "description": "Detailed description of this metric." + }, + "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." + }, + "unit": { + "$ref": "#/definitions/Unit", + "description": "The unit of the metric." + }, + "timeseries": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeSeriesElement" + }, + "x-ms-identifiers": [], + "description": "the time series returned when a data query is performed." + } + }, + "required": [ + "id", + "type", + "name", + "unit", + "timeseries" + ], + "description": "The result data of a query." + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json index 0702469e56b5..519b26abe9df 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json @@ -326,7 +326,7 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/Metric" + "$ref": "../../../../commonDefinitions.json#/definitions/Metric" }, "description": "The value of the collection." } @@ -339,222 +339,6 @@ } } } - }, - "LocalizableString": { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "string", - "description": "The invariant value." - }, - "localizedValue": { - "type": "string", - "description": "The display name." - } - }, - "description": "The localizable string class." - }, - "MetricUnit": { - "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": "MetricUnit", - "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": { - "type": "object", - "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": { - "type": "object", - "properties": { - "name": { - "$ref": "#/definitions/LocalizableString", - "description": "The name of the metadata." - }, - "value": { - "type": "string", - "description": "The value of the metadata." - } - }, - "description": "Represents a metric metadata value." - }, - "Metric": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The metric Id." - }, - "name": { - "$ref": "#/definitions/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": "#/definitions/MetricUnit", - "description": "The unit of the metric." - }, - "timeseries": { - "type": "array", - "items": { - "$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": [ - "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." } } } diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json deleted file mode 100644 index fd3705c9aa81..000000000000 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2023-10-01", - "title": "Common Monitoring types" - }, - "paths": {}, - "definitions": { - "LocalizableString": { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "string", - "description": "The invariant value." - }, - "localizedValue": { - "type": "string", - "description": "The display name." - } - }, - "description": "The localizable string class." - }, - "MetricValue": { - "type": "object", - "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": { - "type": "object", - "properties": { - "name": { - "$ref": "#/definitions/LocalizableString", - "description": "The name of the metadata." - }, - "value": { - "type": "string", - "description": "The value of the metadata." - } - }, - "description": "Represents a metric metadata value." - } - } -} \ No newline at end of file diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/examples/MetricBatchExample.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/examples/MetricBatchExample.json deleted file mode 100644 index ccdb2c2ffdc4..000000000000 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/examples/MetricBatchExample.json +++ /dev/null @@ -1,543 +0,0 @@ -{ - "parameters": { - "baseUrl": "https://eastus.metrics.monitor.azure.com", - "subscriptionId": "123456728-abcd-1234-abcd-123456789abc", - "starttime": "2023-02-01T20:00:00.123Z", - "endtime": "2023-02-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 '*'", - "api-version": "2023-05-01-preview", - "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": { - "values": [ - { - "starttime": "2023-02-01T20:00:00.123Z", - "endtime": "2023-02-01T23:00:00.345Z", - "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": "2023-02-01T20:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2023-02-01T20:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2023-02-01T20:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2023-02-01T20:45:00Z", - "average": 437.54477611940297, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2023-02-01T21:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2023-02-01T21:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2023-02-01T21:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2023-02-01T21:45:00Z", - "average": 437.54477611940297, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2023-02-01T22:00:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2023-02-01T22:15:00Z", - "average": 438.0735294117647, - "minimum": 437, - "maximum": 583 - }, - { - "timeStamp": "2023-02-01T22:30:00Z", - "average": 437, - "minimum": 437, - "maximum": 437 - }, - { - "timeStamp": "2023-02-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": "2023-02-01T20:00:00Z" - }, - { - "timeStamp": "2023-02-01T20:15:00Z" - }, - { - "timeStamp": "2023-02-01T20:30:00Z" - }, - { - "timeStamp": "2023-02-01T20:45:00Z" - }, - { - "timeStamp": "2023-02-01T21:00:00Z" - }, - { - "timeStamp": "2023-02-01T21:15:00Z" - }, - { - "timeStamp": "2023-02-01T21:30:00Z" - }, - { - "timeStamp": "2023-02-01T21:45:00Z" - }, - { - "timeStamp": "2023-02-01T22:00:00Z", - "average": 342, - "minimum": 342, - "maximum": 342 - }, - { - "timeStamp": "2023-02-01T22:15:00Z" - }, - { - "timeStamp": "2023-02-01T22:30:00Z" - }, - { - "timeStamp": "2023-02-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": "2023-02-01T20:00:00Z" - }, - { - "timeStamp": "2023-02-01T20:15:00Z" - }, - { - "timeStamp": "2023-02-01T20:30:00Z" - }, - { - "timeStamp": "2023-02-01T20:45:00Z" - }, - { - "timeStamp": "2023-02-01T21:00:00Z" - }, - { - "timeStamp": "2023-02-01T21:15:00Z" - }, - { - "timeStamp": "2023-02-01T21:30:00Z" - }, - { - "timeStamp": "2023-02-01T21:45:00Z" - }, - { - "timeStamp": "2023-02-01T22:00:00Z", - "average": 796, - "minimum": 796, - "maximum": 796 - }, - { - "timeStamp": "2023-02-01T22:15:00Z" - }, - { - "timeStamp": "2023-02-01T22:30:00Z" - }, - { - "timeStamp": "2023-02-01T22:45:00Z" - } - ] - }, - { - "metadatavalues": [ - { - "name": { - "value": "apiname", - "localizedValue": "apiname" - }, - "value": "GetBlob" - }, - { - "name": { - "value": "authentication", - "localizedValue": "authentication" - }, - "value": "SAS" - } - ], - "data": [ - { - "timeStamp": "2023-02-01T20:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2023-02-01T20:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2023-02-01T20:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2023-02-01T20:45:00Z", - "average": 363.4514925373134, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2023-02-01T21:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2023-02-01T21:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2023-02-01T21:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2023-02-01T21:45:00Z", - "average": 363.4514925373134, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2023-02-01T22:00:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2023-02-01T22:15:00Z", - "average": 365.83088235294116, - "minimum": 361, - "maximum": 1018 - }, - { - "timeStamp": "2023-02-01T22:30:00Z", - "average": 361, - "minimum": 361, - "maximum": 361 - }, - { - "timeStamp": "2023-02-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" - }, - { - "starttime": "2023-02-01T20:00:00.123Z", - "endtime": "2023-02-01T23:00:00.345Z", - "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": "2023-02-01T20:00:00Z" - }, - { - "timeStamp": "2023-02-01T20:15:00Z" - }, - { - "timeStamp": "2023-02-01T20:30:00Z" - }, - { - "timeStamp": "2023-02-01T20:45:00Z" - }, - { - "timeStamp": "2023-02-01T21:00:00Z" - }, - { - "timeStamp": "2023-02-01T21:15:00Z" - }, - { - "timeStamp": "2023-02-01T21:30:00Z" - }, - { - "timeStamp": "2023-02-01T21:45:00Z" - }, - { - "timeStamp": "2023-02-01T22:00:00Z", - "average": 330, - "minimum": 330, - "maximum": 330 - }, - { - "timeStamp": "2023-02-01T22:15:00Z" - }, - { - "timeStamp": "2023-02-01T22:30:00Z" - }, - { - "timeStamp": "2023-02-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": "2023-02-01T20:00:00Z" - }, - { - "timeStamp": "2023-02-01T20:15:00Z" - }, - { - "timeStamp": "2023-02-01T20:30:00Z" - }, - { - "timeStamp": "2023-02-01T20:45:00Z" - }, - { - "timeStamp": "2023-02-01T21:00:00Z" - }, - { - "timeStamp": "2023-02-01T21:15:00Z" - }, - { - "timeStamp": "2023-02-01T21:30:00Z" - }, - { - "timeStamp": "2023-02-01T21:45:00Z" - }, - { - "timeStamp": "2023-02-01T22:00:00Z", - "average": 880, - "minimum": 880, - "maximum": 880 - }, - { - "timeStamp": "2023-02-01T22:15:00Z" - }, - { - "timeStamp": "2023-02-01T22:30:00Z" - }, - { - "timeStamp": "2023-02-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": [ - { - "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-11-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json deleted file mode 100644 index 64a8e9e53774..000000000000 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-11-01-preview/metricBatch.json +++ /dev/null @@ -1,531 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure Monitor Metric Batch", - "version": "2023-05-01-preview" - }, - "securityDefinitions": { - "AADToken": { - "type": "oauth2", - "tokenUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/token", - "flow": "application", - "description": "Azure Active Directory OAuth2 Authentication", - "scopes": { - "https://metrics.monitor.azure.com/.default": "https://metrics.monitor.azure.com/.default" - } - } - }, - "security": [ - { - "AADToken": [ - "https://metrics.monitor.azure.com/.default" - ] - } - ], - "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}", - "useSchemePrefix": false, - "positionInOperation": "first", - "parameters": [ - { - "name": "endpoint", - "description": "The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources. For global resources, the region should be 'global'.", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "client", - "format": "url" - } - ] - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/metrics:getBatch": { - "post": { - "tags": [ - "Metrics" - ], - "operationId": "MetricsBatch_Batch", - "description": "Lists the metric values for multiple resources.", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/StartTimeParameter" - }, - { - "$ref": "#/parameters/EndTimeParameter" - }, - { - "$ref": "#/parameters/IntervalParameter" - }, - { - "$ref": "#/parameters/MetricNamespaceParameter" - }, - { - "$ref": "#/parameters/MetricNamesParameter" - }, - { - "$ref": "#/parameters/AggregationsParameter" - }, - { - "$ref": "#/parameters/TopParameter" - }, - { - "$ref": "#/parameters/OrderByParameter" - }, - { - "$ref": "#/parameters/FilterParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ResourceIdList" - } - ], - "responses": { - "200": { - "description": "The response to a metrics query.", - "schema": { - "$ref": "#/definitions/MetricResultsResponse" - } - }, - "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" - } - } - }, - "x-ms-examples": { - "Query Storage Metrics": { - "$ref": "./examples/MetricBatchExample.json" - } - } - } - } - }, - "parameters": { - "ResourceIdList": { - "name": "resourceIds", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ResourceIdList" - }, - "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.", - "x-ms-parameter-location": "method" - }, - "StartTimeParameter": { - "name": "startTime", - "in": "query", - "required": false, - "type": "string", - "description": "The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required.\nIf only starttime is specified, then endtime defaults to the current time.\nIf no time interval is specified, the default is 1 hour.", - "x-ms-parameter-location": "method" - }, - "EndTimeParameter": { - "name": "endTime", - "in": "query", - "required": false, - "type": "string", - "description": "The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.", - "x-ms-parameter-location": "method" - }, - "IntervalParameter": { - "name": "interval", - "in": "query", - "required": false, - "type": "string", - "format": "duration", - "default": "PT1M", - "description": "The interval (i.e. timegrain) of the query.\n*Examples: PT15M, PT1H, P1D*", - "x-ms-parameter-location": "method" - }, - "MetricNamespaceParameter": { - "name": "metricnamespace", - "in": "query", - "required": true, - "type": "string", - "description": "Metric namespace that contains the requested metric names.", - "x-ms-parameter-location": "method" - }, - "MetricNamesParameter": { - "name": "metricnames", - "in": "query", - "required": true, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "csv", - "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.\n*Examples: average, minimum, maximum*", - "x-ms-parameter-location": "method" - }, - "TopParameter": { - "name": "top", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "description": "The maximum number of records to retrieve per resource ID in the request.\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.\n*Examples: 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", - "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": "object", - "properties": { - "resourceids": { - "description": "The list of resource IDs to query metrics for.", - "type": "array", - "items": { - "type": "string", - "format": "arm-id" - } - } - }, - "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": { - "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" - } - }, - "required": [ - "code", - "message" - ] - } - }, - "required": [ - "error" - ] - }, - "MetricResultsResponse": { - "description": "The metrics result for a resource.", - "type": "object", - "properties": { - "values": { - "description": "The collection of metric data responses per resource, per metric.", - "type": "array", - "items": { - "type": "object", - "properties": { - "starttime": { - "type": "string", - "description": "The start time, in datetime format, for which the data was retrieved." - }, - "endtime": { - "type": "string", - "description": "The end time, in datetime format, for which the data was retrieved." - }, - "interval": { - "type": "string", - "format": "duration", - "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", - "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/QueryBatchMetric" - }, - "description": "The value of the collection." - } - }, - "required": [ - "starttime", - "endtime", - "value" - ] - } - } - } - }, - "QueryBatchMetricValue": { - "type": "object", - "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." - }, - "QueryBatchMetric": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The metric Id." - }, - "name": { - "$ref": "./commonDefinitions.json#/definitions/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": "#/definitions/QueryBatchMetricUnit", - "description": "The unit of the metric." - }, - "timeseries": { - "type": "array", - "items": { - "$ref": "#/definitions/QueryBatchTimeSeriesElement" - }, - "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": [ - "id", - "name", - "displayDescription", - "type", - "unit", - "timeseries" - ], - "description": "The result data of a query." - }, - "QueryBatchTimeSeriesElement": { - "type": "object", - "properties": { - "metadatavalues": { - "type": "array", - "items": { - "$ref": "./commonDefinitions.json#/definitions/MetadataValue" - }, - "description": "The metadata values returned if filter was specified in the call." - }, - "data": { - "type": "array", - "items": { - "$ref": "./commonDefinitions.json#/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." - }, - "QueryBatchMetricUnit": { - "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": "QueryBatchMetricUnit", - "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." - } - ] - } - } - } -} \ No newline at end of file diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metricsDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metricsDefinitions_API.json deleted file mode 100644 index 347257717169..000000000000 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metricsDefinitions_API.json +++ /dev/null @@ -1,273 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "MonitorManagementClient", - "version": "2018-01-01" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{resourceUri}/providers/Microsoft.Insights/metricDefinitions": { - "get": { - "tags": [ - "MetricDefinitions" - ], - "operationId": "MetricDefinitions_List", - "description": "Lists the metric definitions for the resource.", - "parameters": [ - { - "$ref": "#/parameters/ResourceUriParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/MetricNamespaceParameter" - } - ], - "responses": { - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "200": { - "description": "Successful request to get the list of metric definitions", - "schema": { - "$ref": "#/definitions/MetricDefinitionCollection" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - }, - "x-ms-examples": { - "Get Metric Definitions without filter": { - "$ref": "./examples/GetMetricDefinitions.json" - }, - "Get Application Insights Metric Definitions without filter": { - "$ref": "./examples/GetMetricDefinitionsApplicationInsights.json" - }, - "Get StorageCache Metric Definitions with metric class": { - "$ref": "./examples/GetMetricDefinitionsMetricClass.json" - } - } - } - } - }, - "definitions": { - "MetricAvailability": { - "type": "object", - "properties": { - "timeGrain": { - "type": "string", - "format": "duration", - "description": "the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc." - }, - "retention": { - "type": "string", - "format": "duration", - "description": "the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc." - } - }, - "description": "Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain." - }, - "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": "MetricUnit", - "modelAsString": true - } - }, - "AggregationType": { - "type": "string", - "description": "the aggregation type of the metric.", - "enum": [ - "None", - "Average", - "Count", - "Minimum", - "Maximum", - "Total" - ], - "x-ms-enum": { - "name": "AggregationType", - "modelAsString": false - } - }, - "MetricClass": { - "type": "string", - "description": "The class of the metric.", - "enum": [ - "Availability", - "Transactions", - "Errors", - "Latency", - "Saturation" - ], - "x-ms-enum": { - "name": "MetricClass", - "modelAsString": true - } - }, - "MetricDefinition": { - "type": "object", - "properties": { - "isDimensionRequired": { - "type": "boolean", - "description": "Flag to indicate whether the dimension is required." - }, - "resourceId": { - "type": "string", - "description": "the resource identifier of the resource that emitted the metric." - }, - "namespace": { - "type": "string", - "description": "the namespace the metric belongs to." - }, - "name": { - "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/LocalizableString", - "description": "the name and the display name of the metric, i.e. it is a localizable string." - }, - "displayDescription": { - "type": "string", - "description": "Detailed description of this metric." - }, - "category": { - "type": "string", - "description": "Custom category name for this metric." - }, - "metricClass": { - "$ref": "#/definitions/MetricClass", - "description": "The class of the metric." - }, - "unit": { - "$ref": "#/definitions/Unit", - "description": "The unit of the metric." - }, - "primaryAggregationType": { - "$ref": "#/definitions/AggregationType", - "description": "the primary aggregation type value defining how to use the values for display." - }, - "supportedAggregationTypes": { - "type": "array", - "items": { - "$ref": "#/definitions/AggregationType" - }, - "description": "the collection of what aggregation types are supported." - }, - "metricAvailabilities": { - "type": "array", - "items": { - "$ref": "#/definitions/MetricAvailability" - }, - "description": "the collection of what aggregation intervals are available to be queried." - }, - "id": { - "type": "string", - "description": "the resource identifier of the metric definition." - }, - "dimensions": { - "type": "array", - "items": { - "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/LocalizableString" - }, - "description": "the name and the display name of the dimension, i.e. it is a localizable string." - } - }, - "description": "Metric definition class specifies the metadata for a metric." - }, - "MetricDefinitionCollection": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/MetricDefinition" - }, - "description": "the values for the metric definitions." - } - }, - "required": [ - "value" - ], - "description": "Represents collection of metric definitions." - }, - "ErrorResponse": { - "description": "Describes the format of Error response.", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string" - }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string" - } - } - } - }, - "parameters": { - "ResourceUriParameter": { - "name": "resourceUri", - "in": "path", - "required": true, - "type": "string", - "description": "The identifier of the resource.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - }, - "MetricNamespaceParameter": { - "name": "metricnamespace", - "in": "query", - "required": false, - "type": "string", - "description": "Metric namespace to query metric definitions for.", - "x-ms-parameter-location": "method" - } - } - } \ No newline at end of file diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json deleted file mode 100644 index d6c96a8434d2..000000000000 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-11-01-preview/metrics_API.json +++ /dev/null @@ -1,343 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "MonitorManagementClient", - "version": "2018-01-01" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{resourceUri}/providers/Microsoft.Insights/metrics": { - "get": { - "tags": [ - "Metrics" - ], - "operationId": "Metrics_List", - "description": "**Lists the metric values for a resource**.", - "parameters": [ - { - "$ref": "#/parameters/ResourceUriParameter" - }, - { - "$ref": "#/parameters/TimespanParameter" - }, - { - "$ref": "#/parameters/IntervalParameter" - }, - { - "$ref": "#/parameters/MetricNamesParameter" - }, - { - "$ref": "#/parameters/AggregationsParameter" - }, - { - "$ref": "#/parameters/TopParameter" - }, - { - "$ref": "#/parameters/OrderByParameter" - }, - { - "name": "$filter", - "in": "query", - "type": "string", - "description": "The **$filter** is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= \"dim (test) 1 eq '*' \" use **$filter= \"dim %2528test%2529 1 eq '*' \"** When dimension name is **dim (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= \"dim (test) 3 eq 'dim3 (test) val' \" use **$filter= \"dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' \"**", - "required": false - }, - { - "$ref": "#/parameters/ResultTypeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/MetricNamespaceParameter" - } - ], - "responses": { - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "200": { - "description": "Successful request to get the list of metric values.", - "schema": { - "$ref": "#/definitions/Response" - } - } - }, - "x-ms-odata": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/MetaDataValue", - "x-ms-examples": { - "Get Metric for data": { - "$ref": "./examples/GetMetric.json" - }, - "Get Metric for metadata": { - "$ref": "./examples/GetMetricMetadata.json" - }, - "Get Metric with error": { - "$ref": "./examples/GetMetricError.json" - } - } - } - } - }, - "definitions": { - "Response": { - "type": "object", - "properties": { - "cost": { - "type": "number", - "format": "int32", - "minimum": 0, - "description": "The integer value representing the relative cost of the query." - }, - "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 being queried" - }, - "resourceregion": { - "type": "string", - "description": "The region of the resource being queried for metrics." - }, - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/Metric" - }, - "description": "the value of the collection." - } - }, - "required": [ - "timespan", - "value" - ], - "description": "The response to a metrics query." - }, - "Metric": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "the metric Id." - }, - "type": { - "type": "string", - "description": "the resource type of the metric resource." - }, - "name": { - "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/LocalizableString", - "description": "the name and the display name of the metric, i.e. it is localizable string." - }, - "displayDescription": { - "type": "string", - "description": "Detailed description of this metric." - }, - "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." - }, - "unit": { - "$ref": "#/definitions/Unit", - "description": "The unit of the metric." - }, - "timeseries": { - "type": "array", - "items": { - "$ref": "#/definitions/TimeSeriesElement" - }, - "description": "the time series returned when a data query is performed." - } - }, - "required": [ - "id", - "type", - "name", - "unit", - "timeseries" - ], - "description": "The result data of a query." - }, - "TimeSeriesElement": { - "type": "object", - "properties": { - "metadatavalues": { - "type": "array", - "items": { - "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/definitions/MetadataValue" - }, - "description": "the metadata values returned if $filter was specified in the call." - }, - "data": { - "type": "array", - "items": { - "$ref": "../../../../data-plane/Microsoft.Insights/preview/2023-11-01-preview/commonDefinitions.json#/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." - }, - "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" - } - } - } - }, - "parameters": { - "ResourceUriParameter": { - "name": "resourceUri", - "in": "path", - "required": true, - "type": "string", - "description": "The identifier of the resource.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - }, - "TimespanParameter": { - "name": "timespan", - "in": "query", - "required": false, - "type": "string", - "description": "The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.", - "x-ms-parameter-location": "method" - }, - "IntervalParameter": { - "name": "interval", - "in": "query", - "required": false, - "type": "string", - "format": "duration", - "description": "The interval (i.e. timegrain) of the query.", - "x-ms-parameter-location": "method" - }, - "MetricNamesParameter": { - "name": "metricnames", - "in": "query", - "required": false, - "type": "string", - "description": "The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**", - "x-ms-parameter-location": "method" - }, - "AggregationsParameter": { - "name": "aggregation", - "in": "query", - "required": false, - "type": "string", - "description": "The list of aggregation types (comma separated) to retrieve.", - "x-ms-parameter-location": "method" - }, - "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.", - "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.", - "x-ms-parameter-location": "method" - }, - "ResultTypeParameter": { - "name": "resultType", - "in": "query", - "type": "string", - "enum": [ - "Data", - "Metadata" - ], - "x-ms-enum": { - "name": "ResultType", - "modelAsString": false - }, - "description": "Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details.", - "x-ms-parameter-location": "method", - "required": false - }, - "MetricNamespaceParameter": { - "name": "metricnamespace", - "in": "query", - "required": false, - "type": "string", - "description": "Metric namespace to query metric definitions for.", - "x-ms-parameter-location": "method" - }, - "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": "MetricUnit", - "modelAsString": true - } - } - } - } \ No newline at end of file diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json index 5be6305c7682..07e1891d790c 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json @@ -83,22 +83,6 @@ } }, "definitions": { - "LocalizableString": { - "required": [ - "value" - ], - "properties": { - "value": { - "type": "string", - "description": "the invariant value." - }, - "localizedValue": { - "type": "string", - "description": "the locale specific value." - } - }, - "description": "The localizable string class." - }, "MetricAvailability": { "type": "object", "properties": { @@ -115,29 +99,6 @@ }, "description": "Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain." }, - "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": "MetricUnit", - "modelAsString": true - } - }, "AggregationType": { "type": "string", "description": "the aggregation type of the metric.", @@ -185,7 +146,7 @@ "description": "the namespace the metric belongs to." }, "name": { - "$ref": "#/definitions/LocalizableString", + "$ref": "../../../../../commonDefinitions.json#/definitions/LocalizableString", "description": "the name and the display name of the metric, i.e. it is a localizable string." }, "displayDescription": { @@ -201,7 +162,7 @@ "description": "The class of the metric." }, "unit": { - "$ref": "#/definitions/Unit", + "$ref": "../../../../../commonDefinitions.json#/definitions/Unit", "description": "The unit of the metric." }, "primaryAggregationType": { @@ -230,7 +191,7 @@ "dimensions": { "type": "array", "items": { - "$ref": "#/definitions/LocalizableString" + "$ref": "../../../../../commonDefinitions.json#/definitions/LocalizableString" }, "x-ms-identifiers": [ "value" diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json index 9182b3041d0f..f80628cf14fe 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json @@ -93,7 +93,7 @@ } } }, - "x-ms-odata": "#/definitions/MetadataValue", + "x-ms-odata": "./commonDefinitions.json#/definitions/MetadataValue", "x-ms-examples": { "Get Metric for data": { "$ref": "./examples/GetMetric.json" @@ -109,98 +109,6 @@ } }, "definitions": { - "LocalizableString": { - "required": [ - "value" - ], - "properties": { - "value": { - "type": "string", - "description": "the invariant value." - }, - "localizedValue": { - "type": "string", - "description": "the locale specific value." - } - }, - "description": "The localizable string class." - }, - "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": "MetricUnit", - "modelAsString": true - } - }, - "MetricValue": { - "type": "object", - "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": { - "type": "object", - "properties": { - "name": { - "$ref": "#/definitions/LocalizableString", - "description": "the name of the metadata." - }, - "value": { - "type": "string", - "description": "the value of the metadata." - } - }, - "description": "Represents a metric metadata value." - }, "Response": { "type": "object", "properties": { @@ -230,7 +138,7 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/Metric" + "$ref": "./commonDefinitions.json#/definitions/Metric" }, "description": "the value of the collection." } @@ -241,81 +149,6 @@ ], "description": "The response to a metrics query." }, - "Metric": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "the metric Id." - }, - "type": { - "type": "string", - "description": "the resource type of the metric resource." - }, - "name": { - "$ref": "#/definitions/LocalizableString", - "description": "the name and the display name of the metric, i.e. it is localizable string." - }, - "displayDescription": { - "type": "string", - "description": "Detailed description of this metric." - }, - "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." - }, - "unit": { - "$ref": "#/definitions/Unit", - "description": "The unit of the metric." - }, - "timeseries": { - "type": "array", - "items": { - "$ref": "#/definitions/TimeSeriesElement" - }, - "x-ms-identifiers": [], - "description": "the time series returned when a data query is performed." - } - }, - "required": [ - "id", - "type", - "name", - "unit", - "timeseries" - ], - "description": "The result data of a query." - }, - "TimeSeriesElement": { - "type": "object", - "properties": { - "metadatavalues": { - "type": "array", - "items": { - "$ref": "#/definitions/MetadataValue" - }, - "x-ms-identifiers": [ - "name" - ], - "description": "the metadata values returned if $filter was specified in the call." - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/MetricValue" - }, - "x-ms-identifiers": [ - "timeStamp" - ], - "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." - }, "ErrorResponse": { "description": "Describes the format of Error response.", "type": "object", From 8c41cf3c9b0654e32f4dbaaf119a72239ea5d644 Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:46:08 -0700 Subject: [PATCH 08/16] Update metricBatch.json --- .../preview/2023-05-01-preview/metricBatch.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json index 519b26abe9df..f52445dc108f 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json @@ -23,17 +23,18 @@ } ], "x-ms-parameterized-host": { - "hostTemplate": "{baseUrl}", + "hostTemplate": "{endpoint}", "useSchemePrefix": false, "positionInOperation": "first", "parameters": [ { - "name": "baseUrl", + "name": "endpoint", "description": "The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources. For global resources, the region should be 'global'.", "required": true, "type": "string", "in": "path", - "x-ms-skip-url-encoding": true + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" } ] }, @@ -49,7 +50,7 @@ "tags": [ "Metrics" ], - "operationId": "Metrics_Batch", + "operationId": "MetricsBatch_QueryBatch", "description": "Lists the metric values for multiple resources.", "parameters": [ { From 2ff0f219ef1edce4c558caba65a02b168228ce61 Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:51:46 -0700 Subject: [PATCH 09/16] wip --- .../preview/2023-05-01-preview/metricBatch.json | 1 - .../Microsoft.Insights/stable/2018-01-01/metrics_API.json | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json index f52445dc108f..42845fec09f6 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json @@ -157,7 +157,6 @@ "in": "query", "required": false, "type": "string", - "format": "duration", "default": "PT1M", "description": "The interval (i.e. timegrain) of the query.\n*Examples: PT15M, PT1H, P1D*", "x-ms-parameter-location": "method" diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json index f80628cf14fe..53d1c7f45deb 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json @@ -93,7 +93,7 @@ } } }, - "x-ms-odata": "./commonDefinitions.json#/definitions/MetadataValue", + "x-ms-odata": "../../../../../commonDefinitions.json#/definitions/MetadataValue", "x-ms-examples": { "Get Metric for data": { "$ref": "./examples/GetMetric.json" @@ -138,7 +138,7 @@ "value": { "type": "array", "items": { - "$ref": "./commonDefinitions.json#/definitions/Metric" + "$ref": "../../../../../commonDefinitions.json#/definitions/Metric" }, "description": "the value of the collection." } From 14c7c216aad262dec42a3a72bf96db0e1c3c578f Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:57:29 -0700 Subject: [PATCH 10/16] update path --- .../preview/2023-05-01-preview/metricBatch.json | 2 +- .../stable/2018-01-01/metricDefinitions_API.json | 6 +++--- .../Microsoft.Insights/stable/2018-01-01/metrics_API.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json index 42845fec09f6..5246404b4593 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json @@ -326,7 +326,7 @@ "value": { "type": "array", "items": { - "$ref": "../../../../commonDefinitions.json#/definitions/Metric" + "$ref": "../../../commonDefinitions.json#/definitions/Metric" }, "description": "The value of the collection." } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json index 07e1891d790c..c6978792544a 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json @@ -146,7 +146,7 @@ "description": "the namespace the metric belongs to." }, "name": { - "$ref": "../../../../../commonDefinitions.json#/definitions/LocalizableString", + "$ref": "../../../../commonDefinitions.json#/definitions/LocalizableString", "description": "the name and the display name of the metric, i.e. it is a localizable string." }, "displayDescription": { @@ -162,7 +162,7 @@ "description": "The class of the metric." }, "unit": { - "$ref": "../../../../../commonDefinitions.json#/definitions/Unit", + "$ref": "../../../../commonDefinitions.json#/definitions/Unit", "description": "The unit of the metric." }, "primaryAggregationType": { @@ -191,7 +191,7 @@ "dimensions": { "type": "array", "items": { - "$ref": "../../../../../commonDefinitions.json#/definitions/LocalizableString" + "$ref": "../../../../commonDefinitions.json#/definitions/LocalizableString" }, "x-ms-identifiers": [ "value" diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json index 53d1c7f45deb..3c9182711720 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json @@ -93,7 +93,7 @@ } } }, - "x-ms-odata": "../../../../../commonDefinitions.json#/definitions/MetadataValue", + "x-ms-odata": "../../../../commonDefinitions.json#/definitions/MetadataValue", "x-ms-examples": { "Get Metric for data": { "$ref": "./examples/GetMetric.json" @@ -138,7 +138,7 @@ "value": { "type": "array", "items": { - "$ref": "../../../../../commonDefinitions.json#/definitions/Metric" + "$ref": "../../../../commonDefinitions.json#/definitions/Metric" }, "description": "the value of the collection." } From 150ca95720ade1b2e32b38918ac89919772aa2a1 Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:59:09 -0700 Subject: [PATCH 11/16] Update metricBatch.json --- .../preview/2023-05-01-preview/metricBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json index 5246404b4593..42845fec09f6 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json @@ -326,7 +326,7 @@ "value": { "type": "array", "items": { - "$ref": "../../../commonDefinitions.json#/definitions/Metric" + "$ref": "../../../../commonDefinitions.json#/definitions/Metric" }, "description": "The value of the collection." } From a74a131367588bafda88accfaaaa783685a31de6 Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:04:09 -0700 Subject: [PATCH 12/16] Update metricBatch.json --- .../preview/2023-05-01-preview/metricBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json index 42845fec09f6..a286f4fee9d8 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json @@ -50,7 +50,7 @@ "tags": [ "Metrics" ], - "operationId": "MetricsBatch_QueryBatch", + "operationId": "MetricsBatch_Batch", "description": "Lists the metric values for multiple resources.", "parameters": [ { From 73362080c5429ed7b603bdb0c57d6085257f58fb Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:08:25 -0700 Subject: [PATCH 13/16] Update metricBatch.json --- .../preview/2023-05-01-preview/metricBatch.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json index a286f4fee9d8..73c2cc9e77d8 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json @@ -33,6 +33,7 @@ "required": true, "type": "string", "in": "path", + "format": "uri", "x-ms-skip-url-encoding": true, "x-ms-parameter-location": "client" } From b1dd7e498140d308c0b5b5ecb0ceae473d1ce42a Mon Sep 17 00:00:00 2001 From: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:23:33 -0700 Subject: [PATCH 14/16] Update commonDefinitions.json --- specification/monitor/commonDefinitions.json | 248 +++++++++---------- 1 file changed, 124 insertions(+), 124 deletions(-) diff --git a/specification/monitor/commonDefinitions.json b/specification/monitor/commonDefinitions.json index 17b44b244cc9..68ba8efc8469 100644 --- a/specification/monitor/commonDefinitions.json +++ b/specification/monitor/commonDefinitions.json @@ -1,130 +1,130 @@ { - "swagger": "2.0", - "info": { - "version": "2023-11-01", - "title": "Common Monitoring types" + "swagger": "2.0", + "info": { + "version": "2023-11-01", + "title": "Common Monitoring types" + }, + "paths": {}, + "definitions": { + "LocalizableString": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "The invariant value." + }, + "localizedValue": { + "type": "string", + "description": "The display name." + } + }, + "description": "The localizable string class." }, - "paths": {}, - "definitions": { - "LocalizableString": { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "string", - "description": "The invariant value." - }, - "localizedValue": { - "type": "string", - "description": "The display name." - } - }, - "description": "The localizable string class." + "MetricValue": { + "type": "object", + "required": [ + "timeStamp" + ], + "properties": { + "timeStamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp for the metric value in ISO 8601 format." }, - "MetricValue": { - "type": "object", - "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": { - "type": "object", - "properties": { - "name": { - "$ref": "#/definitions/LocalizableString", - "description": "The name of the metadata." - }, - "value": { - "type": "string", - "description": "The value of the metadata." - } - }, - "description": "Represents a metric metadata value." - }, - "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": "MetricUnit", - "modelAsString": true - } + "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": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "The name of the metadata." + }, + "value": { + "type": "string", + "description": "The value of the metadata." + } + }, + "description": "Represents a metric metadata value." + }, + "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": "MetricUnit", + "modelAsString": true + } + }, + "TimeSeriesElement": { + "type": "object", + "properties": { + "metadatavalues": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataValue" }, - "TimeSeriesElement": { - "type": "object", - "properties": { - "metadatavalues": { - "type": "array", - "items": { - "$ref": "#/definitions/MetadataValue" - }, - "x-ms-identifiers": [ - "name" - ], - "description": "the metadata values returned if $filter was specified in the call." - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/MetricValue" - }, - "x-ms-identifiers": [ - "timeStamp" - ], - "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." + "x-ms-identifiers": [ + "name" + ], + "description": "the metadata values returned if $filter was specified in the call." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricValue" }, + "x-ms-identifiers": [ + "timeStamp" + ], + "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." + }, "Metric": { "type": "object", "properties": { @@ -174,5 +174,5 @@ ], "description": "The result data of a query." } - } -} \ No newline at end of file + } +} From edbfd5c9d66d96173d959bae77cb1f6da1fbdb6f Mon Sep 17 00:00:00 2001 From: Todd King <58755170+ToddKingMSFT@users.noreply.github.com> Date: Thu, 26 Oct 2023 10:25:18 -0700 Subject: [PATCH 15/16] Change metricBatch.json endpoint string format from "uri" to "url" Change metricBatch.json endpoint string format from "uri" to "url" --- .../preview/2023-05-01-preview/metricBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json index 73c2cc9e77d8..091598dabad4 100644 --- a/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json +++ b/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json @@ -33,7 +33,7 @@ "required": true, "type": "string", "in": "path", - "format": "uri", + "format": "url", "x-ms-skip-url-encoding": true, "x-ms-parameter-location": "client" } From 5625560a208a85aece1705af128ff174763860e2 Mon Sep 17 00:00:00 2001 From: Todd King <58755170+ToddKingMSFT@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:49:07 -0700 Subject: [PATCH 16/16] Remove duration format from interval parameter and properties Remove duration format from interval parameter and properties. These were improperly decorated as format: "duration" however now that model validation is actually running against parameters our model validation is failing as "FULL" has been a long time accepted string to this parameter and has a lot of usage. --- .../Microsoft.Insights/stable/2018-01-01/metrics_API.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json index 3c9182711720..65045c35c588 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json @@ -124,8 +124,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 ISO 8601 duration format with a special case for 'FULL' value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*). \nThis may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified. This is not present if a metadata request was made." }, "namespace": { "type": "string", @@ -187,8 +186,7 @@ "in": "query", "required": false, "type": "string", - "format": "duration", - "description": "The interval (i.e. timegrain) of the query.", + "description": "The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested.\n*Examples: PT15M, PT1H, P1D, FULL*", "x-ms-parameter-location": "method" }, "MetricNamesParameter": {