Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
{
"swagger": "2.0",
"info": {
"title": "Azure Metrics",
"version": "2018-09-01-preview",
"description": "A client for issuing REST requests to the Azure metrics service.",
"x-ms-code-generation-settings": {
"name": "AzureMetricsClient"
}
},
"host": "monitoring.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json; odata=minimalmetadata"
],
"produces": [
"application/json"
],
"paths": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProvider}/{resourceTypeName}/{resourceName}/metrics": {
"post": {
"summary": "Ingestion API used by Azure custom metrics\r\n Responsible of below operation\r\n 1. Authorize the request\r\n 2. Deserialize payload request body\r\n 3. Perform validation of the payload\r\n 4. Commits the payload for metrics ingestion",
"operationId": "azureMonitorCustomMetricsIngestionApi",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "header",
"name": "Content-Type",
"description": "Supports application/json and application/x-ndjson",
"type": "string"
},
{
"in": "header",
"name": "Content-Length",
"description": "Content length of the payload",
"type": "integer",
"format": "int32"
},
{
"in": "header",
"name": "Authorization",
"description": "Authorization token issue for issued for audience https:\\\\monitoring.azure.com",
"type": "string"
},
{
"in": "path",
"name": "subscriptionId",
"description": "The azure subscription id",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "resourceGroupName",
"description": "The ARM resource group name",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "resourceProvider",
"description": "The ARM resource provider name",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "resourceTypeName",
"description": "The ARM resource type name",
"required": true,
"type": "string"
},
{
"in": "path",
"name": "resourceName",
"description": "The ARM resource name",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "The Azure metrics document json payload",
"required": true,
"schema": {
"$ref": "#/definitions/AzureMetricsDocument"
}
}
],
"responses": {
"200": {
"description": "The azure metrics publish succeeded",
"schema": {
"$ref": "#/definitions/AzureMetricsResult"
}
},
"default": {
"description": "An unexpected error from the server. See response object for the reason",
"schema": {
"$ref": "#/definitions/AzureMetricsResult"
}
}
},
"x-ms-examples": {
"Post azure metrics for cows sold with related metadata as dimensions": {
"$ref": "./examples/AzureMetrics_IngestMetrics.json"
}
}
}
}
},
"definitions": {
"AzureMetricsDocument": {
"type": "object",
"properties": {
"time": {
"description": "Gets or sets Time property (in ISO 8601 format)",
"type": "string"
},
"data": {
"$ref": "#/definitions/AzureMetricsData"
}
}
},
"AzureMetricsData": {
"type": "object",
"properties": {
"baseData": {
"$ref": "#/definitions/AzureMetricsBaseData"
}
}
},
"AzureMetricsBaseData": {
"type": "object",
"properties": {
"metric": {
"description": "Gets or sets the Metric name",
"type": "string"
},
"namespace": {
"description": "Gets or sets the Metric namespace",
"type": "string"
},
"dimNames": {
"description": "Gets or sets the list of dimension names (optional)",
"type": "array",
"items": {
"type": "string"
}
},
"series": {
"description": "Gets or sets the list of time series data for the metric (one per unique dimension combination)",
"type": "array",
"items": {
"$ref": "#/definitions/AzureTimeSeriesData"
}
}
}
},
"AzureTimeSeriesData": {
"type": "object",
"properties": {
"dimValues": {
"description": "Gets or sets dimension values",
"type": "array",
"items": {
"type": "string"
}
},
"min": {
"format": "double",
"description": "Gets or sets Min value",
"type": "number"
},
"max": {
"format": "double",
"description": "Gets or sets Max value",
"type": "number"
},
"sum": {
"format": "double",
"description": "Gets or sets Sum value",
"type": "number"
},
"count": {
"format": "int32",
"description": "Gets or sets Count value",
"type": "integer"
}
}
},
"AzureMetricsResult": {
"type": "object",
"properties": {
"statusCode": {
"format": "int32",
"description": "Http status code response ",
"type": "integer"
},
"apiFailureResponse": {
"$ref": "#/definitions/ApiFailureResponse"
}
}
},
"ApiFailureResponse": {
"type": "object",
"properties": {
"error": {
"$ref": "#/definitions/ApiError"
}
}
},
"ApiError": {
"type": "object",
"properties": {
"code": {
"description": "Gets or sets the azure metrics error code",
"type": "string"
},
"message": {
"description": "Gets or sets the azure metrics error message",
"type": "string"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"parameters": {
"api-version": "2018-09-01-preview",
"Content-Type": "application/json",
"Content-Length": 783,
"Authorization": "Bearer {AAD JWT token issued for https:\\\\monitoring.azure.com}",
"subscriptionId": "b7ac8a0c-fbae-4e29-a0f7-09999b8857a1",
"resourceGroupName": "CowsSeller",
"resourceProvider": "Microsoft.Storage",
"resourceTypeName": "storageAccounts",
"resourceName": "cowssellerstore",
"body": {
"time": "2018-08-24T 11:02:00-7:00",
"data": {
"baseData": {
"metric": "CowsSold",
"namespace": "Cows",
"dimNames": [
"Breed",
"Color",
"Age"
],
"series": [
{
"dimValues": [
"Angus",
"Blue",
"5"
],
"min": 5,
"max": 20,
"sum": 30,
"count": 3
}
]
}
}
}
},
"responses": {
"200": {
"body": {
"statusCode": 200
}
}
}
}
Loading