{ "swagger": "2.0", "info": { "title": "Azure SQL Database", "description": "Provides create, read, update and delete functionality for Azure SQL Database resources including servers, databases, elastic pools, recommendations, operations, and usage metrics.", "version": "2014-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics": { "get": { "tags": [ "Databases" ], "operationId": "Databases_ListMetrics", "description": "Returns database metrics.", "x-ms-examples": { "List database usage metrics": { "$ref": "./examples/DatabaseMetricsListWithFilter.json" } }, "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "databaseName", "in": "path", "required": true, "type": "string", "description": "The name of the database." }, { "name": "$filter", "in": "query", "required": true, "type": "string", "description": "An OData filter expression that describes a subset of metrics to return." } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/MetricListResult" } } }, "x-ms-pageable": { "nextLinkName": null } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions": { "get": { "tags": [ "Databases" ], "operationId": "Databases_ListMetricDefinitions", "description": "Returns database metric definitions.", "x-ms-examples": { "List database usage metrics": { "$ref": "./examples/DatabaseMetricsDefinitionsList.json" } }, "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "databaseName", "in": "path", "required": true, "type": "string", "description": "The name of the database." } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/MetricDefinitionListResult" } } }, "x-ms-pageable": { "nextLinkName": null } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics": { "get": { "tags": [ "ElasticPools" ], "operationId": "ElasticPools_ListMetrics", "description": "Returns elastic pool metrics.", "x-ms-examples": { "List database usage metrics": { "$ref": "./examples/ElasticPoolMetricsListWithFilter.json" } }, "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "elasticPoolName", "in": "path", "required": true, "type": "string", "description": "The name of the elastic pool." }, { "name": "$filter", "in": "query", "required": true, "type": "string", "description": "An OData filter expression that describes a subset of metrics to return." } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/MetricListResult" } } }, "x-ms-pageable": { "nextLinkName": null } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions": { "get": { "tags": [ "ElasticPools" ], "operationId": "ElasticPools_ListMetricDefinitions", "description": "Returns elastic pool metric definitions.", "x-ms-examples": { "List database usage metrics": { "$ref": "./examples/ElasticPoolMetricsDefinitionsList.json" } }, "parameters": [ { "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "elasticPoolName", "in": "path", "required": true, "type": "string", "description": "The name of the elastic pool." } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/MetricDefinitionListResult" } } }, "x-ms-pageable": { "nextLinkName": null } } } }, "definitions": { "MetricValue": { "properties": { "count": { "readOnly": true, "type": "number", "format": "int32", "description": "The number of values for the metric." }, "average": { "readOnly": true, "type": "number", "format": "double", "description": "The average value of the metric." }, "maximum": { "readOnly": true, "type": "number", "format": "double", "description": "The max value of the metric." }, "minimum": { "readOnly": true, "type": "number", "format": "double", "description": "The min value of the metric." }, "timestamp": { "readOnly": true, "type": "string", "format": "date-time", "description": "The metric timestamp (ISO-8601 format)." }, "total": { "readOnly": true, "type": "number", "format": "double", "description": "The total value of the metric." } }, "description": "Represents database metrics." }, "MetricName": { "properties": { "value": { "readOnly": true, "type": "string", "description": "The name of the database metric." }, "localizedValue": { "readOnly": true, "type": "string", "description": "The friendly name of the database metric." } }, "description": "A database metric name." }, "Metric": { "properties": { "startTime": { "readOnly": true, "type": "string", "format": "date-time", "description": "The start time for the metric (ISO-8601 format)." }, "endTime": { "readOnly": true, "type": "string", "format": "date-time", "description": "The end time for the metric (ISO-8601 format)." }, "timeGrain": { "readOnly": true, "type": "string", "description": "The time step to be used to summarize the metric values." }, "unit": { "readOnly": true, "type": "string", "description": "The unit of the metric.", "enum": [ "count", "bytes", "seconds", "percent", "countPerSecond", "bytesPerSecond" ], "x-ms-enum": { "modelAsString": true, "name": "UnitType" } }, "name": { "readOnly": true, "$ref": "#/definitions/MetricName", "description": "The name information for the metric." }, "metricValues": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/MetricValue" }, "description": "The metric values for the specified time window and timestep." } }, "description": "Database metrics." }, "MetricListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/Metric" }, "description": "The list of metrics for the database." } }, "required": [ "value" ], "description": "The response to a list database metrics request." }, "MetricAvailability": { "properties": { "retention": { "readOnly": true, "type": "string", "description": "The length of retention for the database metric." }, "timeGrain": { "readOnly": true, "type": "string", "description": "The granularity of the database metric." } }, "description": "A metric availability value." }, "MetricDefinition": { "properties": { "name": { "readOnly": true, "$ref": "#/definitions/MetricName", "description": "The name information for the metric." }, "primaryAggregationType": { "readOnly": true, "type": "string", "description": "The primary aggregation type defining how metric values are displayed.", "enum": [ "None", "Average", "Count", "Minimum", "Maximum", "Total" ], "x-ms-enum": { "modelAsString": true, "name": "PrimaryAggregationType" } }, "resourceUri": { "readOnly": true, "type": "string", "description": "The resource uri of the database." }, "unit": { "readOnly": true, "type": "string", "description": "The unit of the metric.", "enum": [ "Count", "Bytes", "Seconds", "Percent", "CountPerSecond", "BytesPerSecond" ], "x-ms-enum": { "modelAsString": true, "name": "UnitDefinitionType" } }, "metricAvailabilities": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/MetricAvailability" }, "description": "The list of database metric availabilities for the metric." } }, "description": "A database metric definition." }, "MetricDefinitionListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/MetricDefinition" }, "description": "The list of metric definitions for the database." } }, "required": [ "value" ], "description": "The response to a list database metric definitions request." } }, "parameters": { "ServerNameParameter": { "name": "serverName", "in": "path", "required": true, "type": "string", "description": "The name of the server.", "x-ms-parameter-location": "method" } }, "securityDefinitions": { "azure_auth": { "type": "oauth2", "description": "Azure Active Directory OAuth2 Flow", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } } }