Skip to content

Commit

Permalink
[Hub Generated] Review request for Microsoft.Insights to add version …
Browse files Browse the repository at this point in the history
…stable/2023-10-01 (#26655)

* Adds base for updating Microsoft.Insights from version preview/2023-05-01-preview to version 2023-10-01

* Updates readme

* Updates API version in new specs and examples

* Introduce the new 2023-10-01 metrics API versions

* Update

* Fix avacado

* Fix up examples and body  parameters

* Fix example formatting

* Remove paging

* Fix prettier formatting and suppress lint rules that would cause a breaking change if addressed.

* Make changes requested by stewardship board

* update batch examples

* Add x-ms-pageable back in

* Update description

* Just use the existing 2015-04-01 operations API all past APIs used.

* use ErrorResponse from common-types v1 for APIs with legacy error response
  • Loading branch information
ToddKingMSFT authored Dec 8, 2023
1 parent 8e982a3 commit 0373f0e
Show file tree
Hide file tree
Showing 22 changed files with 11,174 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"version": "2023-11-01",
"version": "1.0",
"title": "Common Monitoring types"
},
"paths": {},
Expand Down Expand Up @@ -110,7 +110,7 @@
"x-ms-identifiers": [
"name"
],
"description": "the metadata values returned if $filter was specified in the call."
"description": "The metadata values returned if $filter was specified in the call."
},
"data": {
"type": "array",
Expand All @@ -130,15 +130,15 @@
"properties": {
"id": {
"type": "string",
"description": "the metric Id."
"description": "The metric Id."
},
"type": {
"type": "string",
"description": "the resource type of the metric resource."
"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."
"description": "The name and the display name of the metric, i.e. it is localizable string."
},
"displayDescription": {
"type": "string",
Expand All @@ -162,7 +162,7 @@
"$ref": "#/definitions/TimeSeriesElement"
},
"x-ms-identifiers": [],
"description": "the time series returned when a data query is performed."
"description": "The time series returned when a data query is performed."
}
},
"required": [
Expand Down
303 changes: 303 additions & 0 deletions specification/monitor/common-types/v2/commonMonitoringTypes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
{
"swagger": "2.0",
"info": {
"version": "2.0",
"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,
"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."
}
]
}
},
"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."
},
"ErrorContract": {
"title": "Error Response",
"description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)",
"type": "object",
"properties": {
"error": {
"description": "The error object.",
"$ref": "../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse"
}
}
}
},
"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
},
"RegionParameter": {
"name": "region",
"in": "query",
"required": true,
"type": "string",
"description": "The region where the metrics you want reside.",
"x-ms-parameter-location": "method"
},
"MetricNamespaceParameter": {
"name": "metricnamespace",
"in": "query",
"required": false,
"type": "string",
"description": "Metric namespace where the metrics you want reside.",
"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"
},
"RollUpByParameter": {
"name": "rollupby",
"in": "query",
"required": false,
"type": "string",
"description": "Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"required": false,
"type": "string",
"default": "PT1M",
"description": "The interval (i.e. timegrain) of the query.\n*Examples: PT15M, PT1H, P1D*",
"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"
},
"MetricNamespaceParameter": {
Expand Down Expand Up @@ -309,8 +309,7 @@
},
"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."
"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."
},
"namespace": {
"type": "string",
Expand All @@ -327,7 +326,7 @@
"value": {
"type": "array",
"items": {
"$ref": "../../../../commonDefinitions.json#/definitions/Metric"
"$ref": "../../../../common-types/v1/commonMonitoringTypes.json#/definitions/Metric"
},
"description": "The value of the collection."
}
Expand Down
Loading

0 comments on commit 0373f0e

Please sign in to comment.