diff --git a/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetric.json b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetric.json new file mode 100644 index 000000000000..14a12faa011b --- /dev/null +++ b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetric.json @@ -0,0 +1,95 @@ +{ + "parameters": { + "resourceUri": "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default", + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "metric": "BlobCapacity", + "$filter": "BlobType eq '*'", + "top": "3", + "orderby": "Average asc", + "aggregation": "Average,count", + "interval": "PT1M", + "api-version": "2017-05-01-preview" + }, + "responses": { + "200": { + "body": { + "cost": 0, + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "interval": "PT1M", + "value": [ + { + "id": "/subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default/providers/Microsoft.Insights/metrics/BlobCapacity", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "BlobCapacity", + "localizedValue": "Blob Capacity" + }, + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "blobtype", + "localizedValue": "blobtype" + }, + "value": "PageBlob" + } + ], + "data": [ + { + "timeStamp": "2017-04-14T02:20:00Z", + "count": 0.0 + }, + { + "timeStamp": "2017-04-14T02:21:00Z", + "count": 0.0 + }, + { + "timeStamp": "2017-04-14T02:22:00Z", + "count": 0.0 + }, + { + "timeStamp": "2017-04-14T02:23:00Z", + "count": 1.0, + "average": 0.0 + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "blobtype", + "localizedValue": "blobtype" + }, + "value": "BlockBlob" + } + ], + "data": [ + { + "timeStamp": "2017-04-14T02:20:00Z", + "count": 0.0 + }, + { + "timeStamp": "2017-04-14T02:21:00Z", + "count": 0.0 + }, + { + "timeStamp": "2017-04-14T02:22:00Z", + "count": 0.0 + }, + { + "timeStamp": "2017-04-14T02:23:00Z", + "count": 1.0, + "average": 245.0 + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetricDefinitions.json b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetricDefinitions.json new file mode 100644 index 000000000000..213550d9e048 --- /dev/null +++ b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetricDefinitions.json @@ -0,0 +1,383 @@ +{ + "parameters": { + "resourceUri": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions", + "api-version": "2017-05-01-preview" + }, + "responses": { + "200": { + "body": + { + "value": [{ + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/CpuTime", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "CpuTime", + "localizedValue": "CPU Time" + }, + "isDimensionRequired": false, + "unit": "Seconds", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Requests", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Requests", + "localizedValue": "Requests" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/BytesReceived", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "BytesReceived", + "localizedValue": "Data In" + }, + "isDimensionRequired": false, + "unit": "Bytes", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/BytesSent", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "BytesSent", + "localizedValue": "Data Out" + }, + "isDimensionRequired": false, + "unit": "Bytes", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http101", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http101", + "localizedValue": "Http 101" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http2xx", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http2xx", + "localizedValue": "Http 2xx" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http3xx", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http3xx", + "localizedValue": "Http 3xx" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http401", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http401", + "localizedValue": "Http 401" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http403", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http403", + "localizedValue": "Http 403" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http404", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http404", + "localizedValue": "Http 404" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http406", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http406", + "localizedValue": "Http 406" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http4xx", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http4xx", + "localizedValue": "Http 4xx" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http5xx", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "Http5xx", + "localizedValue": "Http Server Errors" + }, + "isDimensionRequired": false, + "unit": "Count", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/MemoryWorkingSet", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "MemoryWorkingSet", + "localizedValue": "Memory working set" + }, + "isDimensionRequired": false, + "unit": "Bytes", + "primaryAggregationType": "Average", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/AverageMemoryWorkingSet", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "AverageMemoryWorkingSet", + "localizedValue": "Average memory working set" + }, + "isDimensionRequired": false, + "unit": "Bytes", + "primaryAggregationType": "Average", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/AverageResponseTime", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "AverageResponseTime", + "localizedValue": "Average Response Time" + }, + "isDimensionRequired": false, + "unit": "Seconds", + "primaryAggregationType": "Average", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetricMetadata.json b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetricMetadata.json new file mode 100644 index 000000000000..ef66c6b3e529 --- /dev/null +++ b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/examples/GetMetricMetadata.json @@ -0,0 +1,56 @@ +{ + "parameters": { + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "metric": "BlobCapacity", + "$filter": "BlobType eq '*'", + "top": "3", + "orderby": "Average asc", + "aggregation": "Average,count", + "interval": "PT1M", + "resulttype": "metadata", + "resourceUri": "/subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default", + "api-version": "2017-05-01-preview" + }, + "responses": { + "200": { + "body": { + "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", + "value": [ + { + "id": "/subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default/providers/Microsoft.Insights/metrics/BlobCapacity", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "BlobCapacity", + "localizedValue": "Blob Capacity" + }, + "unit": "Bytes", + "timeseries": [ + { + "metadatavalues": [ + { + "name": { + "value": "blobtype", + "localizedValue": "blobtype" + }, + "value": "BlockBlob" + } + ] + }, + { + "metadatavalues": [ + { + "name": { + "value": "blobtype", + "localizedValue": "blobtype" + }, + "value": "PageBlob" + } + ] + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/metricDefinitions_API.json b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/metricDefinitions_API.json new file mode 100644 index 000000000000..f6498a6249da --- /dev/null +++ b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/metricDefinitions_API.json @@ -0,0 +1,297 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorClient", + "version": "2017-05-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/{resourceUri}/providers/microsoft.insights/metricDefinitions": { + "get": { + "tags": [ + "MetricDefinitions" + ], + "operationId": "MetricDefinitions_List", + "description": "Lists the metric definitions for the resource.", + "parameters": [ + { + "$ref": "#/parameters/ResourceUriParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to get the list of metric definitions", + "schema": { + "$ref": "#/definitions/MetricDefinitionCollection" + }, + "examples": { + "application/json": { + "value": [{ + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/CpuTime", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "CpuTime", + "localizedValue": "CPU Time" + }, + "isDimensionRequired": false, + "unit": "Seconds", + "primaryAggregationType": "Total", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/MemoryWorkingSet", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "MemoryWorkingSet", + "localizedValue": "Memory working set" + }, + "isDimensionRequired": false, + "unit": "Bytes", + "primaryAggregationType": "Average", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + }, { + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/AverageMemoryWorkingSet", + "resourceId": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest", + "name": { + "value": "AverageMemoryWorkingSet", + "localizedValue": "Average memory working set" + }, + "isDimensionRequired": false, + "unit": "Bytes", + "primaryAggregationType": "Average", + "metricAvailabilities": [{ + "timeGrain": "PT1M", + "retention": "P30D" + }, { + "timeGrain": "PT1H", + "retention": "P30D" + } + ], + "dimensions": [{ + "value": "Instance", + "localizedValue": "Instance" + } + ] + } + ] + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "Get Metric Definitions without filter": { "$ref": "./examples/GetMetricDefinitions.json" } + } + } + } + }, + "definitions": { + "LocalizableString": { + "required": [ "value" ], + "properties": { + "value": { + "type": "string", + "description": "the invariant value." + }, + "localizedValue": { + "type": "string", + "description": "the locale specific value." + } + }, + "description": "The localizable string class." + }, + "MetricAvailability": { + "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" + ], + "x-ms-enum": { + "name": "Unit", + "modelAsString": false + } + }, + "MetricDefinition": { + "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." + }, + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "the name and the display name of the metric, i.e. it is a localizable string." + }, + "unit": { + "$ref": "#/definitions/Unit", + "description": "the unit of the metric." + }, + "primaryAggregationType": { + "type": "string", + "description": "the primary aggregation type value defining how to use the values for display.", + "enum": [ + "None", + "Average", + "Count", + "Minimum", + "Maximum", + "Total" + ], + "x-ms-enum": { + "name": "AggregationType", + "modelAsString": false + } + }, + "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": "#/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": { + "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": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + }, + "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 + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/metrics_API.json b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/metrics_API.json new file mode 100644 index 000000000000..9ed9f64f50ae --- /dev/null +++ b/specification/monitor/data-plane/microsoft.insights/2017-05-01-preview/metrics_API.json @@ -0,0 +1,404 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorClient", + "version": "2017-05-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/{resourceUri}/providers/microsoft.insights/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/MetricParameter" + }, + { + "$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 ‘*’**.", + "required": false + }, + { + "$ref": "#/parameters/ResultTypeParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to get the list of metric values.", + "schema": { + "$ref": "#/definitions/Response" + }, + "examples": { + "application/json": { + "cost": 0, + "timespan": "2017-08-10T21:44:34Z/2017-08-10T22:44:34Z", + "interval": "PT1M", + "value": [{ + "id": "/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/Microsoft.Insights/metrics/CpuTime", + "type": "Microsoft.Insights/metrics", + "name": { + "value": "CpuTime", + "localizedValue": "CPU Time" + }, + "unit": "Seconds", + "timeseries": [{ + "metadatavalues": [], + "data": [{ + "timeStamp": "2017-08-10T21:44:00Z", + "total": 0.0 + }, { + "timeStamp": "2017-08-10T21:45:00Z", + "total": 0.0 + }, { + "timeStamp": "2017-08-10T21:46:00Z", + "total": 0.0 + }, { + "timeStamp": "2017-08-10T21:47:00Z", + "total": 0.0 + }, { + "timeStamp": "2017-08-10T21:48:00Z", + "total": 0.0 + }, { + "timeStamp": "2017-08-10T21:49:00Z", + "total": 0.0 + }, { + "timeStamp": "2017-08-10T21:50:00Z", + "total": 0.0 + } + ] + } + ] + } + ] + } + } + } + }, + "x-ms-odata": "#/definitions/MetadataValue", + "x-ms-examples": { + "Get Metric for data": { "$ref": "./examples/GetMetric.json" }, + "Get Metric for metadata": { "$ref": "./examples/GetMetricMetadata.json" } + } + } + } + }, + "definitions": { + "LocalizableString": { + "required": [ "value" ], + "properties": { + "value": { + "type": "string", + "description": "the invariant value." + }, + "localizedValue": { + "type": "string", + "description": "the locale specific value." + } + }, + "description": "The localizable string class." + }, + "Unit": { + "type": "string", + "description": "the unit of the metric.", + "enum": [ + "Count", + "Bytes", + "Seconds", + "CountPerSecond", + "BytesPerSecond", + "Percent", + "MilliSeconds" + ], + "x-ms-enum": { + "name": "Unit", + "modelAsString": false + } + }, + "MetricValue": { + "required": [ "timeStamp" ], + "properties": { + "timeStamp": { + "type": "string", + "format": "date-time", + "description": "the timestamp for the metric value in ISO 8601 format." + }, + "average": { + "type": "number", + "format": "double", + "description": "the average value in the time range." + }, + "minimum": { + "type": "number", + "format": "double", + "description": "the least value in the time range." + }, + "maximum": { + "type": "number", + "format": "double", + "description": "the greatest value in the time range." + }, + "total": { + "type": "number", + "format": "double", + "description": "the sum of all of the values in the time range." + }, + "count": { + "type": "integer", + "format": "int64", + "description": "the number of samples in the time range. Can be used to determine the number of values that contributed to the average value." + } + }, + "description": "Represents a metric value." + }, + "MetadataValue": { + "properties": { + "name": { + "$ref": "#/definitions/LocalizableString", + "description": "the name of the metadata." + }, + "value": { + "type": "string", + "description": "the value of the metadata." + } + }, + "description": "Represents a metric metadata value." + }, + "ErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, + "Response": { + "type": "object", + "properties": { + "cost": { + "type": "number", + "format": "int32", + "minimum": 0, + "description": "The integer value representing the cost of the query, for data case." + }, + "timespan": { + "type": "string", + "description": "The timespan for which the data was retrieved. Its value consists of two datatimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested." + }, + "interval": { + "type": "string", + "format": "duration", + "description": "The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made." + }, + "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": "#/definitions/LocalizableString", + "description": "the name and the display name of the metric, i.e. it is localizable string." + }, + "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": "#/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." + } + }, + "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" + }, + "MetricParameter": { + "name": "metric", + "in": "query", + "required": false, + "type": "string", + "description": "The name of the metric 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.", + "x-ms-parameter-location": "method" + }, + "TopParameter": { + "name": "$top", + "in": "query", + "required": false, + "type": "number", + "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 + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } +} \ No newline at end of file diff --git a/specification/monitor/data-plane/readme.md b/specification/monitor/data-plane/readme.md index 5d75d21b2f96..e71806bd62c9 100644 --- a/specification/monitor/data-plane/readme.md +++ b/specification/monitor/data-plane/readme.md @@ -28,9 +28,22 @@ These are the global settings for the MonitorClient API. title: MonitorClient description: Monitor Client openapi-type: data-plane -tag: package-2016-09 +tag: package-2017-05 ``` +### Tag: package-2017-05 + +These settings apply only when `--tag=package-2017-05` is specified on the command line. + +``` yaml $(tag) == 'package-2017-05' +input-file: +- microsoft.insights/2014-04-01/usageMetrics_API.json +- microsoft.insights/2015-04-01/activityLogs_API.json +- microsoft.insights/2015-04-01/eventCategories_API.json +- microsoft.insights/2015-04-01/tenantActivityLogs_API.json +- microsoft.insights/2017-05-01-preview/metricDefinitions_API.json +- microsoft.insights/2017-05-01-preview/metrics_API.json +``` ### Tag: package-2016-09 diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-04-01/actionGroups_API.json b/specification/monitor/resource-manager/microsoft.insights/2017-04-01/actionGroups_API.json index 13c7fa2499a8..185928c288a8 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-04-01/actionGroups_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-04-01/actionGroups_API.json @@ -82,7 +82,10 @@ } }, "default": { - "description": "An error occurred and the action group could not be created or updated." + "description": "An error occurred and the action group could not be created or updated.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } } }, @@ -116,7 +119,10 @@ } }, "default": { - "description": "An error occurred and the action group could not be retrieved. 404: The action group does not exist." + "description": "An error occurred and the action group could not be retrieved. 404: The action group does not exist.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } } }, @@ -150,7 +156,10 @@ "description": "The action group does not exist. It may have already been deleted." }, "default": { - "description": "An error occurred and the action group could not be deleted." + "description": "An error occurred and the action group could not be deleted.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } } } @@ -183,7 +192,10 @@ } }, "default": { - "description": "An error occurred and the list of action groups could not be retrieved." + "description": "An error occurred and the list of action groups could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } } } @@ -219,7 +231,10 @@ } }, "default": { - "description": "An error occurred and the list of action groups could not be retrieved." + "description": "An error occurred and the list of action groups could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } } } @@ -261,7 +276,10 @@ "description": "The receiver was successfully enabled." }, "default": { - "description": "An error occurred and the receiver could not be enabled. 409: The receiver is already enabled in the action group. 404: The action group was not found or no matching receiver was found in the action group." + "description": "An error occurred and the receiver could not be enabled. 409: The receiver is already enabled in the action group. 404: The action group was not found or no matching receiver was found in the action group.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } } } @@ -467,6 +485,20 @@ "required": [ "receiverName" ] + }, + "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": { diff --git a/specification/monitor/resource-manager/microsoft.insights/2017-04-01/activityLogAlerts_API.json b/specification/monitor/resource-manager/microsoft.insights/2017-04-01/activityLogAlerts_API.json index 0da68f559dda..1fa4b24856c0 100644 --- a/specification/monitor/resource-manager/microsoft.insights/2017-04-01/activityLogAlerts_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/2017-04-01/activityLogAlerts_API.json @@ -204,7 +204,7 @@ } }, "x-ms-examples": { - "Path an activity log alert": { + "Patch an activity log alert": { "$ref": "./examples/patchActivityLogAlert.json" } }