From 7daed1d79e28f1b402a664895935585f195d18ef Mon Sep 17 00:00:00 2001 From: Srikanta Date: Fri, 21 May 2021 02:55:40 -0700 Subject: [PATCH 01/24] Update swaggers for logs and metrics queries --- .../metricDefinitions_API.json | 4 +- .../2017-05-01-preview/metrics_API.json | 4 +- .../2021-05-19/OperationalInsights.json | 1373 +++++++++++++++++ .../2021-05-19/examples/metadata-get.json | 284 ++++ .../2021-05-19/examples/metadata-post.json | 284 ++++ .../oms-get-cross-workspace-example.json | 66 + .../2021-05-19/examples/oms-get-example.json | 158 ++ .../oms-post-cross-workspace-example.json | 71 + .../2021-05-19/examples/oms-post-example.json | 156 ++ 9 files changed, 2396 insertions(+), 4 deletions(-) create mode 100644 specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json create mode 100644 specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-get.json create mode 100644 specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-post.json create mode 100644 specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-cross-workspace-example.json create mode 100644 specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-example.json create mode 100644 specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-cross-workspace-example.json create mode 100644 specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-example.json diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json index 8d4f67a2b7a1..430450d8b8c0 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json @@ -214,8 +214,8 @@ "BitsPerSecond" ], "x-ms-enum": { - "name": "Unit", - "modelAsString": false + "name": "MetricUnit", + "modelAsString": true } }, "MetricDefinition": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json index d6bd126f6e6f..c8d1cc195efb 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json @@ -195,8 +195,8 @@ "BitsPerSecond" ], "x-ms-enum": { - "name": "Unit", - "modelAsString": false + "name": "MetricUnit", + "modelAsString": true } }, "MetricValue": { diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json new file mode 100644 index 000000000000..b3e399dc0ada --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json @@ -0,0 +1,1373 @@ +{ + "swagger": "2.0", + "info": { + "version": "2021-05-19", + "title": "Azure Log Analytics", + "description": "This API exposes Azure Log Analytics query capabilities", + "termsOfService": "https://dev.loganalytics.io/tos", + "contact": { + "name": "AIAPI Team", + "url": "https://dev.loganalytics.io/support", + "email": "aiapi@microsoft.com" + }, + "license": { + "name": "Microsoft", + "url": "https://dev.loganalytics.io/license" + } + }, + "host": "api.loganalytics.io", + "basePath": "/v1", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "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" + } + } + }, + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "paths": { + "/workspaces/{workspaceId}/query": { + "get": { + "operationId": "Query_Get", + "summary": "Execute an Analytics query", + "description": "Executes an Analytics query for data", + "x-ms-examples": { + "simple-query": { + "$ref": "examples/oms-get-example.json" + }, + "cross-workspace": { + "$ref": "examples/oms-get-cross-workspace-example.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/workspaceId" + }, + { + "$ref": "#/parameters/queryParam" + }, + { + "$ref": "#/parameters/timespanParam" + } + ], + "responses": { + "200": { + "description": "OK. The API call succeeded and the Analytics query result is in the response payload", + "schema": { + "$ref": "#/definitions/queryResults" + } + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + } + }, + "post": { + "operationId": "Query_Execute", + "summary": "Execute an Analytics query", + "description": "Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query.", + "x-ms-examples": { + "simple-query": { + "$ref": "examples/oms-post-example.json" + }, + "cross-workspace": { + "$ref": "examples/oms-post-cross-workspace-example.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/workspaceId" + }, + { + "$ref": "#/parameters/queryBody" + } + ], + "responses": { + "200": { + "description": "OK. The API call succeeded and the Analytics query result is in the response payload", + "schema": { + "$ref": "#/definitions/queryResults" + } + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + } + } + }, + "/workspaces/{workspaceId}/metadata": { + "get": { + "operationId": "Metadata_Get", + "summary": "Gets metadata information", + "description": "Retrieve the metadata information for the workspace, including its schema, functions, workspace info, categories etc.", + "x-ms-examples": { + "metadataGet": { + "$ref": "examples/metadata-get.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/workspaceId" + } + ], + "responses": { + "200": { + "description": "OK. The API call succeeded and the metadata result is in the response payload", + "schema": { + "$ref": "#/definitions/metadataResults" + } + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + } + }, + "post": { + "operationId": "Metadata_Post", + "summary": "Gets metadata information", + "description": "Retrieve the metadata information for the workspace, including its schema, functions, workspace info, categories etc.", + "x-ms-examples": { + "metadataPost": { + "$ref": "examples/metadata-post.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/workspaceId" + } + ], + "responses": { + "200": { + "description": "OK. The API call succeeded and the metadata result is in the response payload", + "schema": { + "$ref": "#/definitions/metadataResults" + } + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + } + } + }, + "/$batch": { + "post": { + "operationId": "Query_Batch", + "summary": "Execute a batch of Analytics queries", + "description": "Executes a batch of Analytics queries for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query.", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "The batch request body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/batchRequest" + } + } + ], + "responses": { + "200": { + "description": "OK. The API call succeeded and the Analytics query result is in the response payload", + "schema": { + "$ref": "#/definitions/batchResponse" + } + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + } + } + } + }, + "parameters": { + "workspaceId": { + "name": "workspaceId", + "description": "ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal.", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "workspacesParam": { + "name": "workspaces", + "description": "Comma separated workspace IDs to include in cross-workspace queries.", + "in": "query", + "collectionFormat": "csv", + "required": false, + "default": "", + "type": "string", + "x-ms-parameter-location": "method" + }, + "queryParam": { + "name": "query", + "in": "query", + "required": true, + "x-ms-parameter-location": "method", + "description": "The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", + "type": "string" + }, + "queryBody": { + "name": "body", + "in": "body", + "description": "The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", + "required": true, + "schema": { + "$ref": "#/definitions/queryBody" + }, + "x-ms-parameter-location": "method" + }, + "timespanParam": { + "name": "timespan", + "in": "query", + "required": false, + "format": "duration", + "x-ms-parameter-location": "method", + "description": "Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.", + "type": "string" + } + }, + "definitions": { + "queryParam": { + "description": "The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", + "type": "string" + }, + "timespanParam": { + "description": "Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.", + "type": "string" + }, + "workspacesParam": { + "description": "Workspace IDs to include in cross-workspace queries.", + "type": "array", + "items": { + "type": "string" + } + }, + "queryBody": { + "description": "The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", + "type": "object", + "properties": { + "query": { + "description": "The query to execute.", + "$ref": "#/definitions/queryParam" + }, + "timespan": { + "description": "Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.", + "$ref": "#/definitions/timespanParam" + }, + "workspaces": { + "description": "A list of workspaces that are included in the query.", + "$ref": "#/definitions/workspacesParam" + } + }, + "required": [ + "query" + ] + }, + "queryResults": { + "title": "A query response.", + "description": "Contains the tables, columns & rows resulting from a query.", + "type": "object", + "properties": { + "tables": { + "description": "The list of tables, columns and rows.", + "type": "array", + "items": { + "$ref": "#/definitions/table" + } + } + }, + "required": [ + "tables" + ] + }, + "table": { + "title": "A query response table.", + "description": "Contains the columns and rows for one table in a query response.", + "type": "object", + "properties": { + "name": { + "description": "The name of the table.", + "type": "string" + }, + "columns": { + "description": "The list of columns in this table.", + "type": "array", + "items": { + "$ref": "#/definitions/column" + } + }, + "rows": { + "description": "The resulting rows from this query.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "required": [ + "name", + "columns", + "rows" + ] + }, + "column": { + "title": "A table column.", + "description": "A column in a table.", + "type": "object", + "properties": { + "name": { + "description": "The name of this column.", + "type": "string" + }, + "type": { + "description": "The data type of this column.", + "$ref": "#/definitions/ColumnDataType" + } + } + }, + "ColumnDataType": { + "type": "string", + "description": "The data type of this column.", + "enum": [ + "bool", + "datetime", + "dynamic", + "int", + "long", + "real", + "string" + ], + "x-ms-enum": { + "name": "ColumnDataType", + "modelAsString": true + } + }, + "metadataResults": { + "title": "A metadata response.", + "description": "The metadata response for the app, including available tables, etc.", + "type": "object", + "properties": { + "categories": { + "description": "The list of categories that are referenced in this metadata response.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataCategory" + }, + "uniqueItems": true + }, + "resourceTypes": { + "description": "The list of resource types that are referenced in this metadata response.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataResourceType" + }, + "uniqueItems": true + }, + "solutions": { + "description": "The list of Log Analytics solutions installed on the workspace.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataSolution" + }, + "uniqueItems": true + }, + "tables": { + "description": "The list of tables and columns that comprise the schema of the workspace.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataTable" + }, + "uniqueItems": true + }, + "functions": { + "description": "The list of functions stored on the workspace, or introduced by solutions etc.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataFunction" + }, + "uniqueItems": true + }, + "queries": { + "description": "The list of saved queries stored on the workspace, or introduced by solutions, resource types, etc.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataQuery" + }, + "uniqueItems": true + }, + "applications": { + "description": "The list of Application Insights apps that were referenced in the metadata request.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataApplication" + }, + "uniqueItems": true + }, + "workspaces": { + "description": "The list of Log Analytics workspaces that were referenced in the metadata request.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataWorkspace" + }, + "uniqueItems": true + }, + "resources": { + "description": "The list of Azure resources that were referenced in the metadata request.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataResource" + }, + "uniqueItems": true + }, + "permissions": { + "description": "The list of permission rules that affected the metadata request.", + "type": "array", + "items": { + "$ref": "#/definitions/metadataPermissions" + }, + "uniqueItems": true + } + } + }, + "metadataCategory": { + "title": "A metadata category.", + "description": "Categories are used to group other metadata entities.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the category", + "type": "string" + }, + "displayName": { + "description": "The display name of the category", + "type": "string" + }, + "description": { + "description": "The description of the category", + "type": "string" + }, + "related": { + "description": "The related metadata items for the category", + "type": "object", + "properties": { + "tables": { + "description": "The tables related to the category", + "type": "array", + "items": { + "type": "string" + } + }, + "functions": { + "description": "The functions related to the category", + "type": "array", + "items": { + "type": "string" + } + }, + "resourceTypes": { + "description": "The resource types related to the category", + "type": "array", + "items": { + "type": "string" + } + }, + "queries": { + "description": "The saved queries related to the category", + "type": "array", + "items": { + "type": "string" + } + }, + "solutions": { + "description": "The Log Analytics solutions related to the category", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": [ + "id", + "displayName" + ] + }, + "metadataSolution": { + "title": "A Log Analytics solution.", + "description": "Solutions can group tables and functions that are associated with a certain Azure Log Analytics offering.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the Log Analytics solution", + "type": "string" + }, + "name": { + "description": "The name of the Log Analytics solution", + "type": "string" + }, + "displayName": { + "description": "The display name of the Log Analytics solution", + "type": "string" + }, + "description": { + "description": "The description of the Log Analytics solution", + "type": "string" + }, + "tags": { + "description": "The tags that are associated with the Log Analytics solution", + "$ref": "#/definitions/tags" + }, + "properties": { + "description": "The properties of the Log Analytics solution", + "type": "object" + }, + "related": { + "description": "The related metadata items for the Log Analytics solution", + "type": "object", + "properties": { + "tables": { + "description": "The tables related to the Log Analytics solution", + "type": "array", + "items": { + "type": "string" + } + }, + "functions": { + "description": "The functions related to the Log Analytics solution", + "type": "array", + "items": { + "type": "string" + } + }, + "categories": { + "description": "The categories related to the Log Analytics solution", + "type": "array", + "items": { + "type": "string" + } + }, + "queries": { + "description": "The saved queries related to the Log Analytics solution", + "type": "array", + "items": { + "type": "string" + } + }, + "workspaces": { + "description": "The Workspaces referenced in the metadata request that are related to the Log Analytics solution", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "tables" + ] + } + }, + "required": [ + "id", + "name", + "related" + ] + }, + "metadataResourceType": { + "title": "A type of resource in Azure.", + "description": "Metadata about types of Azure resources, containing relevant tables, functions, etc.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the resource-type", + "type": "string" + }, + "type": { + "description": "The type of the resource-type", + "type": "string" + }, + "displayName": { + "description": "The display name of the resource-type", + "type": "string" + }, + "description": { + "description": "The description of the resource-type", + "type": "string" + }, + "labels": { + "description": "The user-defined labels of the resource-type", + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "description": "The tags associated with the resource-type", + "$ref": "#/definitions/tags" + }, + "properties": { + "description": "The properties of the resource-type", + "type": "object" + }, + "related": { + "description": "The related metadata items for the resource-type", + "type": "object", + "properties": { + "tables": { + "description": "The tables related to the resource-type", + "type": "array", + "items": { + "type": "string" + } + }, + "functions": { + "description": "The functions related to the resource-type", + "type": "array", + "items": { + "type": "string" + } + }, + "categories": { + "description": "The categories related to the resource-type", + "type": "array", + "items": { + "type": "string" + } + }, + "queries": { + "description": "The queries related to the resource-type", + "type": "array", + "items": { + "type": "string" + } + }, + "workspaces": { + "description": "The Log Analytics workspaces related to the resource-type", + "type": "array", + "items": { + "type": "string" + } + }, + "resources": { + "description": "The Azure resources related to the resource-type", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": [ + "id", + "type" + ] + }, + "metadataTable": { + "title": "A data table that takes part in a workspace schema.", + "description": "Tables are part of the workspace schema, and contain a list of columns and a reference to other relevant metadata items.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the table", + "type": "string" + }, + "name": { + "description": "The name of the table", + "type": "string" + }, + "description": { + "description": "The description of the table", + "type": "string" + }, + "timespanColumn": { + "description": "The column associated with the timespan query parameter for the table", + "type": "string" + }, + "labels": { + "description": "The user defined labels of the table", + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "description": "The tags associated with the table", + "$ref": "#/definitions/tags" + }, + "properties": { + "description": "The properties of the table", + "type": "object" + }, + "columns": { + "description": "The list of columns defined on the table", + "type": "array", + "items": { + "properties": { + "name": { + "description": "The name of the column", + "type": "string" + }, + "description": { + "description": "The description of the column", + "type": "string" + }, + "type": { + "description": "The data type of the column", + "type": "string", + "enum": [ + "bool", + "datetime", + "dynamic", + "int", + "long", + "real", + "string" + ], + "x-ms-enum": { + "name": "MetadataColumnDataType", + "modelAsString": true + } + }, + "isPreferredFacet": { + "description": "A flag indicating this column is a preferred facet", + "type": "boolean" + }, + "source": { + "description": "an indication of the source of the column, used only when multiple workspaces have conflicting definition for the column", + "type": "object" + } + }, + "required": [ + "name", + "type" + ] + } + }, + "related": { + "description": "The related metadata items for the table", + "type": "object", + "properties": { + "categories": { + "description": "The related categories for the table", + "type": "array", + "items": { + "type": "string" + } + }, + "solutions": { + "description": "The related Log Analytics solutions for the table", + "type": "array", + "items": { + "type": "string" + } + }, + "resourceTypes": { + "description": "The related resource types for the table", + "type": "array", + "items": { + "type": "string" + } + }, + "workspaces": { + "description": "The related Log Analytics workspaces for the table", + "type": "array", + "items": { + "type": "string" + } + }, + "functions": { + "description": "The related functions for the table", + "type": "array", + "items": { + "type": "string" + } + }, + "queries": { + "description": "The related saved queries for the table", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": [ + "id", + "name" + ] + }, + "metadataFunction": { + "title": "A stored function.", + "description": "Functions are stored Kusto queries that can be specified as part of queries by using their name.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the function.", + "type": "string" + }, + "name": { + "description": "The name of the function, to be used in queries.", + "type": "string" + }, + "parameters": { + "description": "The parameters/arguments of the function, if any.", + "type": "string" + }, + "displayName": { + "description": "The display name of the function.", + "type": "string" + }, + "description": { + "description": "The description of the function.", + "type": "string" + }, + "body": { + "description": "The KQL body of the function.", + "type": "string" + }, + "tags": { + "description": "The tags associated with the function.", + "$ref": "#/definitions/tags" + }, + "properties": { + "description": "The properties of the function.", + "type": "object" + }, + "related": { + "description": "The related metadata items for the function.", + "type": "object", + "properties": { + "tables": { + "description": "The related tables for the function.", + "type": "array", + "items": { + "type": "string" + } + }, + "solutions": { + "description": "The related Log Analytics solutions for the function.", + "type": "array", + "items": { + "type": "string" + } + }, + "resourceTypes": { + "description": "The related resource types for the function.", + "type": "array", + "items": { + "type": "string" + } + }, + "categories": { + "description": "The related categories for the function.", + "type": "array", + "items": { + "type": "string" + } + }, + "workspaces": { + "description": "The related workspaces for the function.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": [ + "id", + "name", + "body" + ] + }, + "metadataQuery": { + "title": "A stored query.", + "description": "Queries are stored pieces of KQL, along with a list of relevant metadata items.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the query.", + "type": "string" + }, + "displayName": { + "description": "The display name of the query.", + "type": "string" + }, + "description": { + "description": "The description of the query.", + "type": "string" + }, + "body": { + "description": "The KQL body of the query.", + "type": "string" + }, + "labels": { + "description": "The user defined labels associated with the query.", + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "description": "The tags associated with the query.", + "$ref": "#/definitions/tags" + }, + "properties": { + "description": "The properties of the query.", + "type": "object" + }, + "related": { + "description": "The related metadata items for the query.", + "type": "object", + "properties": { + "categories": { + "description": "The related categories for the query.", + "type": "array", + "items": { + "type": "string" + } + }, + "solutions": { + "description": "The related Log Analytics solutions for the query.", + "type": "array", + "items": { + "type": "string" + } + }, + "resourceTypes": { + "description": "The related resource types for the query.", + "type": "array", + "items": { + "type": "string" + } + }, + "tables": { + "description": "The related tables for the query.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": [ + "id", + "body" + ] + }, + "metadataApplication": { + "title": "An Application Insights application.", + "description": "Application Insights apps that were part of the metadata request and that the user has access to.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the Application Insights app.", + "type": "string" + }, + "resourceId": { + "description": "The ARM resource ID of the Application Insights app.", + "type": "string" + }, + "name": { + "description": "The name of the Application Insights app.", + "type": "string" + }, + "region": { + "description": "The Azure region of the Application Insights app.", + "type": "string" + }, + "related": { + "description": "The related metadata items for the Application Insights app.", + "type": "object", + "properties": { + "tables": { + "description": "The related tables for the Application Insights app.", + "type": "array", + "items": { + "type": "string" + } + }, + "functions": { + "description": "The related functions for the Application Insights app.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": [ + "id", + "resourceId", + "name", + "region" + ] + }, + "metadataWorkspace": { + "title": "A Log Analytics workspace.", + "description": "Log Analytics workspaces that were part of the metadata request and that the user has access to.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the Log Analytics workspace.", + "type": "string" + }, + "resourceId": { + "description": "The ARM resource ID of the Log Analytics workspace.", + "type": "string" + }, + "name": { + "description": "The name of the Log Analytics workspace.", + "type": "string" + }, + "region": { + "description": "The Azure region of the Log Analytics workspace.", + "type": "string" + }, + "related": { + "description": "The related metadata items for the Log Analytics workspace.", + "type": "object", + "properties": { + "tables": { + "description": "The related tables for the Log Analytics workspace.", + "type": "array", + "items": { + "type": "string" + } + }, + "solutions": { + "description": "The related Log Analytics solutions for the Log Analytics workspace.", + "type": "array", + "items": { + "type": "string" + } + }, + "resourceTypes": { + "description": "The related resource types for the Log Analytics workspace.", + "type": "array", + "items": { + "type": "string" + } + }, + "functions": { + "description": "The related functions for the Log Analytics workspace.", + "type": "array", + "items": { + "type": "string" + } + }, + "resources": { + "description": "The related Azure resources for the Log Analytics workspace.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": [ + "id", + "resourceId", + "name", + "region" + ] + }, + "metadataResource": { + "title": "An Azure resource.", + "description": "Azure resources that were part of the metadata request and that the user has access to." + }, + "metadataPermissions": { + "title": "Permission information.", + "description": "Permission information for the metadata call, includes apps/workspaces/resource the user didn't have access to.", + "type": "object", + "properties": { + "workspaces": { + "description": "The permission indication for the workspaces on the metadata request.", + "type": "array", + "items": { + "type": "object", + "properties": { + "resourceId": { + "description": "The resource ID on the permission indication.", + "type": "string" + }, + "denyTables": { + "description": "The list of tables that were denied access for the resource ID.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "resourceId" + ] + } + }, + "resources": { + "description": "The permission indication for the Azure resources on the metadata request.", + "type": "array", + "items": { + "type": "object", + "properties": { + "resourceId": { + "description": "The resource ID on the permission indication.", + "type": "string" + }, + "denyTables": { + "description": "The list of tables that were denied access for the resource ID.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "resourceId" + ] + } + }, + "applications": { + "description": "The permission indication for the Application Insights apps on the metadata request.", + "type": "array", + "items": { + "type": "object", + "properties": { + "resourceId": { + "description": "The resource ID on the permission indication.", + "type": "string" + } + }, + "required": [ + "resourceId" + ] + } + } + }, + "required": [ + "workspaces" + ] + }, + "tags": { + "description": "String-based key-value tags", + "type": "object" + }, + "errorDetail": { + "title": "Error details.", + "type": "object", + "properties": { + "code": { + "description": "The error's code.", + "type": "string" + }, + "message": { + "description": "A human readable error message.", + "type": "string" + }, + "target": { + "description": "Indicates which property in the request is responsible for the error.", + "type": "string" + }, + "value": { + "description": "Indicates which value in 'target' is responsible for the error.", + "type": "string" + }, + "resources": { + "description": "Indicates resources which were responsible for the error.", + "type": "array", + "items": { + "type": "string" + } + }, + "additionalProperties": { + "description": "Additional properties that can be provided on the error details object", + "type": "object" + } + }, + "required": [ + "code", + "message" + ] + }, + "errorInfo": { + "title": "The code and message for an error.", + "type": "object", + "properties": { + "code": { + "description": "A machine readable error code.", + "type": "string" + }, + "message": { + "description": "A human readable error message.", + "type": "string" + }, + "details": { + "description": "error details.", + "type": "array", + "items": { + "$ref": "#/definitions/errorDetail" + } + }, + "innererror": { + "description": "Inner error details if they exist.", + "$ref": "#/definitions/errorInfo" + }, + "additionalProperties": { + "description": "Additional properties that can be provided on the error info object", + "type": "object" + } + }, + "required": [ + "code", + "message" + ] + }, + "errorResponse": { + "title": "Error details.", + "description": "Contains details when the response code indicates an error.", + "type": "object", + "properties": { + "error": { + "description": "The error details.", + "$ref": "#/definitions/errorInfo" + } + }, + "required": [ + "error" + ] + }, + "batchRequest" : { + "type": "object", + "description": "An array of requests.", + "properties": { + "requests": { + "type": "array", + "description": "An single request in a batch.", + "items": { + "$ref": "#/definitions/logQueryRequest" + } + } + } + }, + "logQueryRequest" : { + "type": "object", + "description": "An single request in a batch.", + "properties": { + "id": { + "description": "The error details.", + "type": "string" + }, + "headers" : { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "body": { + "$ref": "#/definitions/queryBody" + }, + "path": { + "type": "string", + "enum": ["/query"] + }, + "method": { + "type": "string", + "enum": ["POST"] + }, + "workspace": { + "description": "Workspace Id to be included in the query", + "type": "string" + } + } + }, + "batchResponse" : { + "type": "object", + "description": "Response to a batch.", + "properties": { + "responses": { + "type": "array", + "description": "An array of responses corresponding to each individual request in a batch.", + "items": { + "$ref": "#/definitions/logQueryResponse" + } + } + } + }, + "logQueryResponse" : { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "body": { + "type": "object", + "$ref": "#/definitions/logQueryResult" + } + } + }, + "logQueryResult": { + "title": "A query response for a single logs query in a batch.", + "description": "Contains the tables, columns & rows resulting from the query or the error details if the query failed.", + "type": "object", + "properties": { + "tables": { + "description": "The list of tables, columns and rows.", + "type": "array", + "items": { + "$ref": "#/definitions/table" + } + }, + "error": { + "$ref": "#/definitions/errorInfo" + } + } + } + } +} diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-get.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-get.json new file mode 100644 index 000000000000..a2c34fe519aa --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-get.json @@ -0,0 +1,284 @@ +{ + "title": "Get Metadata", + "description": "A metadata request that returns the workspace schema and other information", + "parameters": { + "workspaceId": "b438b4f6-912a-46d5-9cb1-b44069212abc", + "apiVersion": "2018-04-20" + }, + "responses": { + "200": { + "body": { + "tables": [ + { + "id": "ADAssessmentRecommendation", + "name": "ADAssessmentRecommendation", + "description": "Recommendations generated by AD assessments that are started through a scheduled task. When you schedule the assessment it runs by default every 7 days and upload the data into Azure Log Analytics", + "timespanColumn": "TimeGenerated", + "columns": [ + { + "name": "SourceSystem", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "AssessmentId", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "RecommendationId", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Recommendation", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Description", + "type": "string" + }, + { + "name": "RecommendationResult", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "TimeGenerated", + "type": "datetime" + }, + { + "name": "FocusAreaId", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "FocusArea", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "ActionAreaId", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "ActionArea", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "RecommendationWeight", + "type": "real" + }, + { + "name": "Computer", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "AffectedObjectType", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "AffectedObjectName", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Forest", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Domain", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "DomainController", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Technology", + "type": "string" + }, + { + "name": "CustomData", + "type": "string" + }, + { + "name": "TargetCount", + "type": "int" + }, + { + "name": "IsRollup", + "type": "bool", + "isPreferredFacet": true + }, + { + "name": "IsCopied", + "type": "bool", + "isPreferredFacet": true + }, + { + "name": "RecommendationPeriod", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Type", + "type": "string" + }, + { + "name": "_ResourceId", + "type": "string" + } + ], + "related": { + "categories": [ + "workloads" + ], + "solutions": [ + "ADAssessment" + ], + "resourceTypes": [ + "microsoft.compute/virtualmachines" + ] + } + }, + { + "id": "custom_CL", + "name": "custom_CL", + "timespanColumn": "TimeGenerated", + "columns": [ + { + "name": "SourceSystem", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "ManagementGroupName", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "TimeGenerated", + "type": "datetime", + "isPreferredFacet": true + }, + { + "name": "Computer", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "RawData", + "type": "string" + }, + { + "name": "Type", + "type": "string" + }, + { + "name": "_ResourceId", + "type": "string" + } + ], + "related": { + "workspaces": [ + "b438b4f6-912a-46d5-9cb1-b44069212abc" + ] + } + } + ], + "solutions": [ + { + "id": "ADAssessment", + "name": "ADAssessment", + "displayName": "Active Directory Health Check", + "description": "Assess the risk and health of Active Directory environments.", + "related": { + "tables": [ + "ADAssessmentRecommendation" + ], + "functions": [ + "dwad" + ], + "workspaces": [ + "b438b4f6-912a-46d5-9cb1-b44069212abc" + ] + } + } + ], + "functions": [ + { + "id": "dwad", + "name": "dwad", + "displayName": "dasd", + "body": "Heartbeat\r\n| where ResourceGroup != \"rg-SAP-DEVQA-005\" and ResourceGroup != \"rg-SAP-DEVQA-006\" and Computer contains \"\"\r\n| limit 500000\r\n| sort by Computer asc\r\n| distinct Computer\r\n", + "related": { + "solutions": [ + "ADAssessment" + ], + "workspaces": [ + "b438b4f6-912a-46d5-9cb1-b44069212abc" + ] + } + } + ], + "resourceTypes": [ + { + "id": "microsoft.compute/virtualmachines", + "type": "Microsoft.Compute/VirtualMachines", + "displayName": "Virtual machines", + "related": { + "tables": [ + "ADAssessmentRecommendation" + ] + } + } + ], + "workspaces": [ + { + "id": "b438b4f6-912a-46d5-9cb1-b44069212abc", + "resourceId": "/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourceGroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-IT", + "name": "contosoretail-IT", + "region": "eastus", + "related": { + "resourceTypes": [ + "microsoft.compute/virtualmachines" + ], + "tables": [ + "custom_CL" + ], + "solutions": [ + "ADAssessment" + ], + "functions": [ + "dwad" + ] + } + } + ], + "categories": [ + { + "id": "workloads", + "displayName": "Workloads", + "related": { + "tables": [ + "ADAssessmentRecommendation", + "ADReplicationResult", + "SQLAssessmentRecommendation", + "WorkloadMonitoringPerf" + ] + } + } + ] + } + } + } +} diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-post.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-post.json new file mode 100644 index 000000000000..ebfe9e55d2af --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-post.json @@ -0,0 +1,284 @@ +{ + "title": "Post Metadata", + "description": "A metadata request that returns the workspace schema and other information", + "parameters": { + "workspaceId": "b438b4f6-912a-46d5-9cb1-b44069212abc", + "apiVersion": "2018-04-20" + }, + "responses": { + "200": { + "body": { + "tables": [ + { + "id": "ADAssessmentRecommendation", + "name": "ADAssessmentRecommendation", + "description": "Recommendations generated by AD assessments that are started through a scheduled task. When you schedule the assessment it runs by default every 7 days and upload the data into Azure Log Analytics", + "timespanColumn": "TimeGenerated", + "columns": [ + { + "name": "SourceSystem", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "AssessmentId", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "RecommendationId", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Recommendation", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Description", + "type": "string" + }, + { + "name": "RecommendationResult", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "TimeGenerated", + "type": "datetime" + }, + { + "name": "FocusAreaId", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "FocusArea", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "ActionAreaId", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "ActionArea", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "RecommendationWeight", + "type": "real" + }, + { + "name": "Computer", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "AffectedObjectType", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "AffectedObjectName", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Forest", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Domain", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "DomainController", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Technology", + "type": "string" + }, + { + "name": "CustomData", + "type": "string" + }, + { + "name": "TargetCount", + "type": "int" + }, + { + "name": "IsRollup", + "type": "bool", + "isPreferredFacet": true + }, + { + "name": "IsCopied", + "type": "bool", + "isPreferredFacet": true + }, + { + "name": "RecommendationPeriod", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "Type", + "type": "string" + }, + { + "name": "_ResourceId", + "type": "string" + } + ], + "related": { + "categories": [ + "workloads" + ], + "solutions": [ + "ADAssessment" + ], + "resourceTypes": [ + "microsoft.compute/virtualmachines" + ] + } + }, + { + "id": "custom_CL", + "name": "custom_CL", + "timespanColumn": "TimeGenerated", + "columns": [ + { + "name": "SourceSystem", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "ManagementGroupName", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "TimeGenerated", + "type": "datetime", + "isPreferredFacet": true + }, + { + "name": "Computer", + "type": "string", + "isPreferredFacet": true + }, + { + "name": "RawData", + "type": "string" + }, + { + "name": "Type", + "type": "string" + }, + { + "name": "_ResourceId", + "type": "string" + } + ], + "related": { + "workspaces": [ + "b438b4f6-912a-46d5-9cb1-b44069212abc" + ] + } + } + ], + "solutions": [ + { + "id": "ADAssessment", + "name": "ADAssessment", + "displayName": "Active Directory Health Check", + "description": "Assess the risk and health of Active Directory environments.", + "related": { + "tables": [ + "ADAssessmentRecommendation" + ], + "functions": [ + "dwad" + ], + "workspaces": [ + "b438b4f6-912a-46d5-9cb1-b44069212abc" + ] + } + } + ], + "functions": [ + { + "id": "dwad", + "name": "dwad", + "displayName": "dasd", + "body": "Heartbeat\r\n| where ResourceGroup != \"rg-SAP-DEVQA-005\" and ResourceGroup != \"rg-SAP-DEVQA-006\" and Computer contains \"\"\r\n| limit 500000\r\n| sort by Computer asc\r\n| distinct Computer\r\n", + "related": { + "solutions": [ + "ADAssessment" + ], + "workspaces": [ + "b438b4f6-912a-46d5-9cb1-b44069212abc" + ] + } + } + ], + "resourceTypes": [ + { + "id": "microsoft.compute/virtualmachines", + "type": "Microsoft.Compute/VirtualMachines", + "displayName": "Virtual machines", + "related": { + "tables": [ + "ADAssessmentRecommendation" + ] + } + } + ], + "workspaces": [ + { + "id": "b438b4f6-912a-46d5-9cb1-b44069212abc", + "resourceId": "/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourceGroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-IT", + "name": "contosoretail-IT", + "region": "eastus", + "related": { + "resourceTypes": [ + "microsoft.compute/virtualmachines" + ], + "tables": [ + "custom_CL" + ], + "solutions": [ + "ADAssessment" + ], + "functions": [ + "dwad" + ] + } + } + ], + "categories": [ + { + "id": "workloads", + "displayName": "Workloads", + "related": { + "tables": [ + "ADAssessmentRecommendation", + "ADReplicationResult", + "SQLAssessmentRecommendation", + "WorkloadMonitoringPerf" + ] + } + } + ] + } + } + } +} diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-cross-workspace-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-cross-workspace-example.json new file mode 100644 index 000000000000..d1e3647f86ef --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-cross-workspace-example.json @@ -0,0 +1,66 @@ +{ + "title": "Cross Workspace Query", + "description": "A cross workspace query that the type and count of each row per workspace.", + "parameters": { + "workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111", + "query": "union * | where TimeGenerated > ago(1h) | summarize count() by Type, TenantId", + "workspaces": "draft-test,draft-test-2" + }, + "responses": { + "200": { + "body": { + "tables": [ + { + "name": "PrimaryResult", + "columns": [ + { + "name": "Type", + "type": "string" + }, + { + "name": "TenantId", + "type": "string" + }, + { + "name": "count_", + "type": "long" + } + ], + "rows": [ + [ + "Usage", + "63613592-b6f7-4c3d-a390-22ba13102111", + "1" + ], + [ + "Usage", + "d436f322-a9f4-4aad-9a7d-271fbf66001c", + "1" + ], + [ + "BillingFact", + "63613592-b6f7-4c3d-a390-22ba13102111", + "1" + ], + [ + "BillingFact", + "d436f322-a9f4-4aad-9a7d-271fbf66001c", + "1" + ], + [ + "Operation", + "63613592-b6f7-4c3d-a390-22ba13102111", + "7" + ], + [ + "Operation", + "d436f322-a9f4-4aad-9a7d-271fbf66001c", + "5" + ] + ] + } + ] + } + } + } +} diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-example.json new file mode 100644 index 000000000000..5b4e6d426e57 --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-example.json @@ -0,0 +1,158 @@ +{ + "title": "Simple Query", + "description": "A simple query that returns query results.", + "parameters": { + "workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111", + "query": "Usage | take 10", + "timespan": "PT12H" + }, + "responses": { + "200": { + "headers": { + "x-ms-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5", + "x-ms-correlation-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5" + }, + "body": { + "tables": [ + { + "name": "PrimaryResult", + "columns": [ + { + "name": "TenantId", + "type": "string" + }, + { + "name": "Computer", + "type": "string" + }, + { + "name": "TimeGenerated", + "type": "datetime" + }, + { + "name": "SourceSystem", + "type": "string" + }, + { + "name": "StartTime", + "type": "datetime" + }, + { + "name": "EndTime", + "type": "datetime" + }, + { + "name": "ResourceUri", + "type": "string" + }, + { + "name": "LinkedResourceUri", + "type": "string" + }, + { + "name": "DataType", + "type": "string" + }, + { + "name": "Solution", + "type": "string" + }, + { + "name": "BatchesWithinSla", + "type": "long" + }, + { + "name": "BatchesOutsideSla", + "type": "long" + }, + { + "name": "BatchesCapped", + "type": "long" + }, + { + "name": "TotalBatches", + "type": "long" + }, + { + "name": "AvgLatencyInSeconds", + "type": "real" + }, + { + "name": "Quantity", + "type": "real" + }, + { + "name": "QuantityUnit", + "type": "string" + }, + { + "name": "IsBillable", + "type": "bool" + }, + { + "name": "MeterId", + "type": "string" + }, + { + "name": "LinkedMeterId", + "type": "string" + }, + { + "name": "Type", + "type": "string" + } + ], + "rows": [ + [ + "b438b4f6-912a-46d5-9cb1-b44069212abc", + "ContosoSQLSrv1", + "2017-08-24T06:59:59Z", + "OMS", + "2017-08-24T06:00:00Z", + "2017-08-24T06:59:59Z", + "/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it", + null, + "Perf", + "LogManagement", + "1", + "0", + "0", + "1", + "1.286", + "0.076408", + "MBytes", + "true", + "a4e29a95-5b4c-408b-80e3-113f9410566e", + "00000000-0000-0000-0000-000000000000", + "Usage" + ], + [ + "b438b4f6-912a-46d5-9cb1-b44069212abc", + "Store010Web3", + "2017-08-24T06:59:59Z", + "OMS", + "2017-08-24T06:00:00Z", + "2017-08-24T06:59:59Z", + "/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it", + null, + "Perf", + "LogManagement", + "1", + "0", + "0", + "1", + "1.7", + "0.106767", + "MBytes", + "true", + "a4e29a95-5b4c-408b-80e3-113f9410566e", + "00000000-0000-0000-0000-000000000000", + "Usage" + ] + ] + } + ] + } + } + } +} diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-cross-workspace-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-cross-workspace-example.json new file mode 100644 index 000000000000..20a06125bd66 --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-cross-workspace-example.json @@ -0,0 +1,71 @@ +{ + "title": "Cross Workspace Query", + "description": "A cross workspace query that the type and count of each row per workspace.", + "parameters": { + "workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111", + "body": { + "query": "union * | where TimeGenerated > ago(1h) | summarize count() by Type, TenantId", + "workspaces": [ + "draft-test", + "draft-test-2" + ] + } + }, + "responses": { + "200": { + "body": { + "tables": [ + { + "name": "PrimaryResult", + "columns": [ + { + "name": "Type", + "type": "string" + }, + { + "name": "TenantId", + "type": "string" + }, + { + "name": "count_", + "type": "long" + } + ], + "rows": [ + [ + "Usage", + "63613592-b6f7-4c3d-a390-22ba13102111", + "1" + ], + [ + "Usage", + "d436f322-a9f4-4aad-9a7d-271fbf66001c", + "1" + ], + [ + "BillingFact", + "63613592-b6f7-4c3d-a390-22ba13102111", + "1" + ], + [ + "BillingFact", + "d436f322-a9f4-4aad-9a7d-271fbf66001c", + "1" + ], + [ + "Operation", + "63613592-b6f7-4c3d-a390-22ba13102111", + "7" + ], + [ + "Operation", + "d436f322-a9f4-4aad-9a7d-271fbf66001c", + "5" + ] + ] + } + ] + } + } + } +} diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-example.json new file mode 100644 index 000000000000..57a53fa2a365 --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-example.json @@ -0,0 +1,156 @@ +{ + "title": "Simple Query", + "description": "A simple query that returns query results.", + "parameters": { + "workspaceId": "63613592-b6f7-4c3d-a390-22ba13102111", + "body": { + "query": "Usage | take 10", + "timespan": "PT12H" + } + }, + "responses": { + "200": { + "body": { + "tables": [ + { + "name": "PrimaryResult", + "columns": [ + { + "name": "TenantId", + "type": "string" + }, + { + "name": "Computer", + "type": "string" + }, + { + "name": "TimeGenerated", + "type": "datetime" + }, + { + "name": "SourceSystem", + "type": "string" + }, + { + "name": "StartTime", + "type": "datetime" + }, + { + "name": "EndTime", + "type": "datetime" + }, + { + "name": "ResourceUri", + "type": "string" + }, + { + "name": "LinkedResourceUri", + "type": "string" + }, + { + "name": "DataType", + "type": "string" + }, + { + "name": "Solution", + "type": "string" + }, + { + "name": "BatchesWithinSla", + "type": "long" + }, + { + "name": "BatchesOutsideSla", + "type": "long" + }, + { + "name": "BatchesCapped", + "type": "long" + }, + { + "name": "TotalBatches", + "type": "long" + }, + { + "name": "AvgLatencyInSeconds", + "type": "real" + }, + { + "name": "Quantity", + "type": "real" + }, + { + "name": "QuantityUnit", + "type": "string" + }, + { + "name": "IsBillable", + "type": "bool" + }, + { + "name": "MeterId", + "type": "string" + }, + { + "name": "LinkedMeterId", + "type": "string" + }, + { + "name": "Type", + "type": "string" + } + ], + "rows": [ + [ + "b438b4f6-912a-46d5-9cb1-b44069212abc", + "ContosoSQLSrv1", + "2017-08-24T06:59:59Z", + "OMS", + "2017-08-24T06:00:00Z", + "2017-08-24T06:59:59Z", + "/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it", + null, + "Perf", + "LogManagement", + "1", + "0", + "0", + "1", + "1.286", + "0.076408", + "MBytes", + "true", + "a4e29a95-5b4c-408b-80e3-113f9410566e", + "00000000-0000-0000-0000-000000000000", + "Usage" + ], + [ + "b438b4f6-912a-46d5-9cb1-b44069212abc", + "Store010Web3", + "2017-08-24T06:59:59Z", + "OMS", + "2017-08-24T06:00:00Z", + "2017-08-24T06:59:59Z", + "/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourcegroups/contosoazurehq/providers/microsoft.operationalinsights/workspaces/contosoretail-it", + null, + "Perf", + "LogManagement", + "1", + "0", + "0", + "1", + "1.7", + "0.106767", + "MBytes", + "true", + "a4e29a95-5b4c-408b-80e3-113f9410566e", + "00000000-0000-0000-0000-000000000000", + "Usage" + ] + ] + } + ] + } + } + } +} From b3bfaff53b3a7eac6efb295cb50309ae5b78c320 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Fri, 21 May 2021 02:57:02 -0700 Subject: [PATCH 02/24] Update version --- .../preview/2021-05-19/OperationalInsights.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json index b3e399dc0ada..d3ea11af7e24 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2021-05-19", + "version": "2021-05-19_Preview", "title": "Azure Log Analytics", "description": "This API exposes Azure Log Analytics query capabilities", "termsOfService": "https://dev.loganalytics.io/tos", From 94ac050a98bfac9d0764b4e708ed52903cc01966 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Fri, 21 May 2021 12:18:41 -0700 Subject: [PATCH 03/24] add missing fields --- .../2021-05-19/OperationalInsights.json | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json index d3ea11af7e24..309605ba7434 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json @@ -102,6 +102,9 @@ }, { "$ref": "#/parameters/queryBody" + }, + { + "$ref": "#/parameters/PreferHeaderParameter" } ], "responses": { @@ -259,6 +262,14 @@ "x-ms-parameter-location": "method", "description": "Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.", "type": "string" + }, + "PreferHeaderParameter": { + "name": "Prefer", + "in": "header", + "required": false, + "type": "string", + "description": "Optional. The prefer header to set server timeout, ", + "x-ms-parameter-location": "method" } }, "definitions": { @@ -270,13 +281,35 @@ "description": "Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.", "type": "string" }, + "workspacesParam": { + "description": "Workspace names to include in cross-workspace queries.", + "type": "array", + "items": { + "type": "string" + } + }, + "workspaceIdsParam": { "description": "Workspace IDs to include in cross-workspace queries.", "type": "array", "items": { "type": "string" } }, + "qualifiedNamesParam": { + "description": "Qualified Name - string with format //.", + "type": "array", + "items": { + "type": "string" + } + }, + "azureResourceIdsParam": { + "description": "Azure Resource ID - string with format /subscriptions//resourceGroups//providers/microsoft.operationalinsights/workspaces/.", + "type": "array", + "items": { + "type": "string" + } + }, "queryBody": { "description": "The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", "type": "object", @@ -292,6 +325,18 @@ "workspaces": { "description": "A list of workspaces that are included in the query.", "$ref": "#/definitions/workspacesParam" + }, + "qualifiedNames": { + "description": "A list of qualified workspace names that are included in the query.", + "$ref": "#/definitions/qualifiedNamesParam" + }, + "workspaceIds": { + "description": "A list of workspace IDs that are included in the query.", + "$ref": "#/definitions/workspaceIdsParam" + }, + "azureResourceIds": { + "description": "A list of Azure resource IDs that are included in the query.", + "$ref": "#/definitions/azureResourceIdsParam" } }, "required": [ From 8a6b14c7cf6049d6eade0a1b8a92a8899a4eeb00 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Fri, 21 May 2021 14:12:51 -0700 Subject: [PATCH 04/24] include statistics --- .../preview/2021-05-19/OperationalInsights.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json index 309605ba7434..b5e6b66396a8 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json @@ -354,6 +354,10 @@ "items": { "$ref": "#/definitions/table" } + }, + "statistics": { + "type": "object", + "description": "Statistics represented in JSON format." } }, "required": [ @@ -1394,6 +1398,12 @@ "body": { "type": "object", "$ref": "#/definitions/logQueryResult" + }, + "headers" : { + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, From 80cf358c87f90304b2c135de8e8e9835a93721ac Mon Sep 17 00:00:00 2001 From: Srikanta Date: Fri, 21 May 2021 15:04:12 -0700 Subject: [PATCH 05/24] include statistics --- .../preview/2021-05-19/OperationalInsights.json | 4 ---- .../stable/v1/OperationalInsights.json | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json index b5e6b66396a8..4d65f87be08d 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json @@ -354,10 +354,6 @@ "items": { "$ref": "#/definitions/table" } - }, - "statistics": { - "type": "object", - "description": "Statistics represented in JSON format." } }, "required": [ diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json index c7a54b986d00..26aec067f6ea 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json @@ -276,6 +276,10 @@ "items": { "$ref": "#/definitions/table" } + }, + "statistics": { + "type": "object", + "description": "Statistics represented in JSON format." } }, "required": [ From fe671b080633e8f6c73eea8c4004b6065936f98c Mon Sep 17 00:00:00 2001 From: Srikanta Date: Fri, 21 May 2021 15:30:20 -0700 Subject: [PATCH 06/24] statistics in log query result --- .../preview/2021-05-19/OperationalInsights.json | 6 ++++++ .../stable/v1/OperationalInsights.json | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json index 4d65f87be08d..06c97f8d2523 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json @@ -354,6 +354,12 @@ "items": { "$ref": "#/definitions/table" } + }, + "statistics": { + "type": "object", + "description": "Statistics represented in JSON format.", + "properties": { + } } }, "required": [ diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json index 26aec067f6ea..c7a54b986d00 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json @@ -276,10 +276,6 @@ "items": { "$ref": "#/definitions/table" } - }, - "statistics": { - "type": "object", - "description": "Statistics represented in JSON format." } }, "required": [ From a8bbcbb5d5a6a2a2a84bd83e29d4752784b57285 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Sun, 23 May 2021 22:31:09 -0700 Subject: [PATCH 07/24] Include metrics namespace param --- .../preview/2017-05-01-preview/metricDefinitions_API.json | 8 ++++++++ .../preview/2017-05-01-preview/metrics_API.json | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json index 430450d8b8c0..7dd48283c681 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json @@ -320,6 +320,14 @@ "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" } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json index c8d1cc195efb..711abdddcda3 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json @@ -437,6 +437,14 @@ "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" } } } From 73d0a2715c90b5db8f6f42d013d34ad9439ab369 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Sun, 23 May 2021 22:46:55 -0700 Subject: [PATCH 08/24] Update title and client name --- .../preview/2017-05-01-preview/metricDefinitions_API.json | 4 ++-- .../preview/2017-12-01-preview/metricNamespaces_API.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json index 7dd48283c681..42646683d197 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json @@ -1,9 +1,9 @@ { "swagger": "2.0", "info": { - "title": "MonitorManagementClient", + "title": "MetricsDefinitionsClient", "x-ms-code-generation-settings": { - "name": "MonitorManagementClient" + "name": "MetricsDefinitionsClient" }, "version": "2017-05-01-preview" }, diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json index 37567b416cb7..8c051aeeca84 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json @@ -1,9 +1,9 @@ { "swagger": "2.0", "info": { - "title": "MonitorManagementClient", + "title": "MetricsNamespacesClient", "x-ms-code-generation-settings": { - "name": "MonitorManagementClient" + "name": "MetricsNamespacesClient" }, "version": "2017-12-01-preview" }, From 2c3281c28078c42bdfa760024353f5dff312cd48 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Sun, 23 May 2021 23:10:47 -0700 Subject: [PATCH 09/24] Include namespace param --- .../preview/2017-05-01-preview/metricDefinitions_API.json | 3 +++ .../preview/2017-05-01-preview/metrics_API.json | 3 +++ .../preview/2017-12-01-preview/metricNamespaces_API.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json index 42646683d197..85476e7949e5 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json @@ -49,6 +49,9 @@ }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/MetricNamespaceParameter" } ], "responses": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json index 711abdddcda3..5c2820a8d37a 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json @@ -77,6 +77,9 @@ }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/MetricNamespaceParameter" } ], "responses": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json index 8c051aeeca84..f3544f79ff08 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json @@ -99,7 +99,7 @@ ], "x-ms-enum": { "name": "NamespaceClassification", - "modelAsString": false + "modelAsString": true } }, "MetricNamespace": { From 1edabc649adce2862c65d8fbff4484fbf9b92665 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Mon, 24 May 2021 11:31:26 -0700 Subject: [PATCH 10/24] Add namespace and region --- .../preview/2017-05-01-preview/metrics_API.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json index 5c2820a8d37a..e990df17cd3a 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json @@ -285,6 +285,14 @@ "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 been queried" + }, + "resourceregion": { + "type": "string", + "description": "The region of the resource been queried for metrics." + }, "value": { "type": "array", "items": { From 0b0838b35d2727bb7bdb9ce44fc2db1577bc3ccb Mon Sep 17 00:00:00 2001 From: Srikanta Date: Mon, 24 May 2021 13:59:30 -0700 Subject: [PATCH 11/24] Fix top and orderby query params --- .../preview/2017-05-01-preview/metrics_API.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json index e990df17cd3a..c1fa8f79f48b 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json @@ -417,7 +417,7 @@ "x-ms-parameter-location": "method" }, "TopParameter": { - "name": "$top", + "name": "top", "in": "query", "required": false, "type": "number", @@ -426,7 +426,7 @@ "x-ms-parameter-location": "method" }, "OrderByParameter": { - "name": "$orderby", + "name": "orderby", "in": "query", "required": false, "type": "string", From 35ba912fcb160ca6c8d8ea4369b25342de43b768 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Mon, 31 May 2021 22:27:34 -0700 Subject: [PATCH 12/24] Fix linting errors --- .../metricDefinitions_API.json | 5 +--- .../metricNamespaces_API.json | 5 +--- .../2021-05-19/OperationalInsights.json | 24 ++++++++++--------- .../operationalinsights/data-plane/readme.md | 9 +++++++ 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json index 85476e7949e5..18d2acb0d083 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json @@ -1,10 +1,7 @@ { "swagger": "2.0", "info": { - "title": "MetricsDefinitionsClient", - "x-ms-code-generation-settings": { - "name": "MetricsDefinitionsClient" - }, + "title": "MonitorManagementClient", "version": "2017-05-01-preview" }, "host": "management.azure.com", diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json index f3544f79ff08..1b999fa03926 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json @@ -1,10 +1,7 @@ { "swagger": "2.0", "info": { - "title": "MetricsNamespacesClient", - "x-ms-code-generation-settings": { - "name": "MetricsNamespacesClient" - }, + "title": "MonitorManagementClient", "version": "2017-12-01-preview" }, "host": "management.azure.com", diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json index 06c97f8d2523..84497eb94d40 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json @@ -281,7 +281,6 @@ "description": "Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.", "type": "string" }, - "workspacesParam": { "description": "Workspace names to include in cross-workspace queries.", "type": "array", @@ -358,8 +357,7 @@ "statistics": { "type": "object", "description": "Statistics represented in JSON format.", - "properties": { - } + "properties": {} } }, "required": [ @@ -1331,7 +1329,7 @@ "error" ] }, - "batchRequest" : { + "batchRequest": { "type": "object", "description": "An array of requests.", "properties": { @@ -1344,7 +1342,7 @@ } } }, - "logQueryRequest" : { + "logQueryRequest": { "type": "object", "description": "An single request in a batch.", "properties": { @@ -1352,7 +1350,7 @@ "description": "The error details.", "type": "string" }, - "headers" : { + "headers": { "type": "object", "additionalProperties": { "type": "string" @@ -1363,11 +1361,15 @@ }, "path": { "type": "string", - "enum": ["/query"] + "enum": [ + "/query" + ] }, "method": { "type": "string", - "enum": ["POST"] + "enum": [ + "POST" + ] }, "workspace": { "description": "Workspace Id to be included in the query", @@ -1375,7 +1377,7 @@ } } }, - "batchResponse" : { + "batchResponse": { "type": "object", "description": "Response to a batch.", "properties": { @@ -1388,7 +1390,7 @@ } } }, - "logQueryResponse" : { + "logQueryResponse": { "type": "object", "properties": { "id": { @@ -1401,7 +1403,7 @@ "type": "object", "$ref": "#/definitions/logQueryResult" }, - "headers" : { + "headers": { "type": "object", "additionalProperties": { "type": "string" diff --git a/specification/operationalinsights/data-plane/readme.md b/specification/operationalinsights/data-plane/readme.md index f1e857ed5d8f..cf2da53d33de 100644 --- a/specification/operationalinsights/data-plane/readme.md +++ b/specification/operationalinsights/data-plane/readme.md @@ -52,6 +52,15 @@ directive: transform: $.operationId = "Query" ``` +``` yaml $(tag) == '20210519' +input-file: +- Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +directive: + - reason: Include batch query and add prefer headers to query request + where-operation: Query_Post + transform: $.operationId = "Query" +``` + --- # Code Generation From b102029c8b2cc762d7fb96e53b7d76533a3c76c5 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Mon, 31 May 2021 22:43:36 -0700 Subject: [PATCH 13/24] Update security to oauth2 --- .../preview/2021-05-19/OperationalInsights.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json index 84497eb94d40..7e78313d4302 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json @@ -39,7 +39,7 @@ }, "security": [ { - "azure_auth": [ + "oauth2": [ "user_impersonation" ] } From e0aac6f6618991c8266231adda5548c54df81da7 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Mon, 31 May 2021 23:54:52 -0700 Subject: [PATCH 14/24] Revert metrics changes --- .../metricDefinitions_API.json | 18 ++++--------- .../2017-05-01-preview/metrics_API.json | 27 +++---------------- .../metricNamespaces_API.json | 5 +++- 3 files changed, 13 insertions(+), 37 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json index 18d2acb0d083..8d4f67a2b7a1 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metricDefinitions_API.json @@ -2,6 +2,9 @@ "swagger": "2.0", "info": { "title": "MonitorManagementClient", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, "version": "2017-05-01-preview" }, "host": "management.azure.com", @@ -46,9 +49,6 @@ }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/MetricNamespaceParameter" } ], "responses": { @@ -214,8 +214,8 @@ "BitsPerSecond" ], "x-ms-enum": { - "name": "MetricUnit", - "modelAsString": true + "name": "Unit", + "modelAsString": false } }, "MetricDefinition": { @@ -320,14 +320,6 @@ "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" } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json index c1fa8f79f48b..d6bd126f6e6f 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-05-01-preview/metrics_API.json @@ -77,9 +77,6 @@ }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/MetricNamespaceParameter" } ], "responses": { @@ -198,8 +195,8 @@ "BitsPerSecond" ], "x-ms-enum": { - "name": "MetricUnit", - "modelAsString": true + "name": "Unit", + "modelAsString": false } }, "MetricValue": { @@ -285,14 +282,6 @@ "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 been queried" - }, - "resourceregion": { - "type": "string", - "description": "The region of the resource been queried for metrics." - }, "value": { "type": "array", "items": { @@ -417,7 +406,7 @@ "x-ms-parameter-location": "method" }, "TopParameter": { - "name": "top", + "name": "$top", "in": "query", "required": false, "type": "number", @@ -426,7 +415,7 @@ "x-ms-parameter-location": "method" }, "OrderByParameter": { - "name": "orderby", + "name": "$orderby", "in": "query", "required": false, "type": "string", @@ -448,14 +437,6 @@ "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" } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json index 1b999fa03926..37567b416cb7 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json @@ -2,6 +2,9 @@ "swagger": "2.0", "info": { "title": "MonitorManagementClient", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, "version": "2017-12-01-preview" }, "host": "management.azure.com", @@ -96,7 +99,7 @@ ], "x-ms-enum": { "name": "NamespaceClassification", - "modelAsString": true + "modelAsString": false } }, "MetricNamespace": { From ef469d03ea3cd4a7d9d3b86ddc6a9c089240357f Mon Sep 17 00:00:00 2001 From: Srikanta Date: Wed, 2 Jun 2021 11:48:59 -0700 Subject: [PATCH 15/24] Update path --- .../{2021-05-19 => 2021-05-19_Preview}/OperationalInsights.json | 0 .../{2021-05-19 => 2021-05-19_Preview}/examples/metadata-get.json | 0 .../examples/metadata-post.json | 0 .../examples/oms-get-cross-workspace-example.json | 0 .../examples/oms-get-example.json | 0 .../examples/oms-post-cross-workspace-example.json | 0 .../examples/oms-post-example.json | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/{2021-05-19 => 2021-05-19_Preview}/OperationalInsights.json (100%) rename specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/{2021-05-19 => 2021-05-19_Preview}/examples/metadata-get.json (100%) rename specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/{2021-05-19 => 2021-05-19_Preview}/examples/metadata-post.json (100%) rename specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/{2021-05-19 => 2021-05-19_Preview}/examples/oms-get-cross-workspace-example.json (100%) rename specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/{2021-05-19 => 2021-05-19_Preview}/examples/oms-get-example.json (100%) rename specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/{2021-05-19 => 2021-05-19_Preview}/examples/oms-post-cross-workspace-example.json (100%) rename specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/{2021-05-19 => 2021-05-19_Preview}/examples/oms-post-example.json (100%) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json similarity index 100% rename from specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json rename to specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-get.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/metadata-get.json similarity index 100% rename from specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-get.json rename to specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/metadata-get.json diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-post.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/metadata-post.json similarity index 100% rename from specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/metadata-post.json rename to specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/metadata-post.json diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-cross-workspace-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-get-cross-workspace-example.json similarity index 100% rename from specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-cross-workspace-example.json rename to specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-get-cross-workspace-example.json diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-get-example.json similarity index 100% rename from specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-get-example.json rename to specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-get-example.json diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-cross-workspace-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-post-cross-workspace-example.json similarity index 100% rename from specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-cross-workspace-example.json rename to specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-post-cross-workspace-example.json diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-post-example.json similarity index 100% rename from specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19/examples/oms-post-example.json rename to specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/oms-post-example.json From 2b97b8aee6dd60225d306ed30c4ca1fac84675bd Mon Sep 17 00:00:00 2001 From: Srikanta Date: Wed, 2 Jun 2021 12:07:16 -0700 Subject: [PATCH 16/24] add batch sample --- .../examples/batch-query-example.json | 609 ++++++++++++++++++ 1 file changed, 609 insertions(+) create mode 100644 specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/batch-query-example.json diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/batch-query-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/batch-query-example.json new file mode 100644 index 000000000000..d99beca7ea36 --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/batch-query-example.json @@ -0,0 +1,609 @@ +{ + "title": "Batch Query", + "description": "A batch query that returns query results.", + "parameters": { + "body": { + "requests": [ + { + "id": "1", + "body": { + "query": "AppRequests | take 2" + }, + "path": "/query", + "method": "POST", + "workspace": "d2d0e126-fa1e-4b0a-b647-250cdd471e68" + }, + { + "id": "2", + "body": { + "query": "AppRequests | take 3" + }, + "path": "/query", + "method": "POST", + "workspace": "d2d0e126-fa1e-4b0a-b647-250cdd471e68" + } + ] + } + }, + "responses": { + "200": { + "body": { + "responses": [ + { + "id": "1", + "status": 200, + "body": { + "tables": [ + { + "name": "PrimaryResult", + "columns": [ + { + "name": "TenantId", + "type": "string" + }, + { + "name": "TimeGenerated", + "type": "datetime" + }, + { + "name": "Id", + "type": "string" + }, + { + "name": "Source", + "type": "string" + }, + { + "name": "Name", + "type": "string" + }, + { + "name": "Url", + "type": "string" + }, + { + "name": "Success", + "type": "bool" + }, + { + "name": "ResultCode", + "type": "string" + }, + { + "name": "DurationMs", + "type": "real" + }, + { + "name": "PerformanceBucket", + "type": "string" + }, + { + "name": "Properties", + "type": "dynamic" + }, + { + "name": "Measurements", + "type": "dynamic" + }, + { + "name": "OperationName", + "type": "string" + }, + { + "name": "OperationId", + "type": "string" + }, + { + "name": "OperationLinks", + "type": "dynamic" + }, + { + "name": "ParentId", + "type": "string" + }, + { + "name": "SyntheticSource", + "type": "string" + }, + { + "name": "SessionId", + "type": "string" + }, + { + "name": "UserId", + "type": "string" + }, + { + "name": "UserAuthenticatedId", + "type": "string" + }, + { + "name": "UserAccountId", + "type": "string" + }, + { + "name": "AppVersion", + "type": "string" + }, + { + "name": "AppRoleName", + "type": "string" + }, + { + "name": "AppRoleInstance", + "type": "string" + }, + { + "name": "ClientType", + "type": "string" + }, + { + "name": "ClientModel", + "type": "string" + }, + { + "name": "ClientOS", + "type": "string" + }, + { + "name": "ClientIP", + "type": "string" + }, + { + "name": "ClientCity", + "type": "string" + }, + { + "name": "ClientStateOrProvince", + "type": "string" + }, + { + "name": "ClientCountryOrRegion", + "type": "string" + }, + { + "name": "ClientBrowser", + "type": "string" + }, + { + "name": "ResourceGUID", + "type": "string" + }, + { + "name": "IKey", + "type": "string" + }, + { + "name": "SDKVersion", + "type": "string" + }, + { + "name": "ItemCount", + "type": "int" + }, + { + "name": "ReferencedItemId", + "type": "string" + }, + { + "name": "ReferencedType", + "type": "string" + }, + { + "name": "SourceSystem", + "type": "string" + }, + { + "name": "Type", + "type": "string" + }, + { + "name": "_ResourceId", + "type": "string" + } + ], + "rows": [ + [ + "d2d0e126-fa1e-4b0a-b647-250cdd471e68", + "2021-06-02T00:18:13.317Z", + "a3273b160f86b5c4", + "", + "ServiceBus.process", + "", + true, + "200", + 0, + "<250ms", + "{\"x-opt-enqueued-time\":\"1622593091\"}", + null, + "ServiceBus.process", + "e5d21caf619d4ef564a4b5920cadce47", + null, + "c6864f9d3649f302", + "", + "", + "", + "", + "", + "", + "", + "srikanta", + "PC", + "", + "", + "0.0.0.0", + "Edmonds", + "Washington", + "United States", + "", + "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be", + "b4f83947-968d-4e2f-82ad-804be07697ae", + "java:3.1.1-BETA.2", + 1, + "", + "", + "Azure", + "AppRequests", + "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights" + ], + [ + "d2d0e126-fa1e-4b0a-b647-250cdd471e68", + "2021-06-02T00:19:13.44Z", + "bebb49e7a1344c07", + "", + "ServiceBus.process", + "", + true, + "200", + 0, + "<250ms", + "{\"x-opt-enqueued-time\":\"1622593091\"}", + null, + "ServiceBus.process", + "d76c6dec50d2c12267d7d3a246a0c237", + null, + "b68fff4775c77214", + "", + "", + "", + "", + "", + "", + "", + "srikanta", + "PC", + "", + "", + "0.0.0.0", + "Edmonds", + "Washington", + "United States", + "", + "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be", + "b4f83947-968d-4e2f-82ad-804be07697ae", + "java:3.1.1-BETA.2", + 1, + "", + "", + "Azure", + "AppRequests", + "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights" + ] + ] + } + ] + } + }, + { + "id": "2", + "status": 200, + "body": { + "tables": [ + { + "name": "PrimaryResult", + "columns": [ + { + "name": "TenantId", + "type": "string" + }, + { + "name": "TimeGenerated", + "type": "datetime" + }, + { + "name": "Id", + "type": "string" + }, + { + "name": "Source", + "type": "string" + }, + { + "name": "Name", + "type": "string" + }, + { + "name": "Url", + "type": "string" + }, + { + "name": "Success", + "type": "bool" + }, + { + "name": "ResultCode", + "type": "string" + }, + { + "name": "DurationMs", + "type": "real" + }, + { + "name": "PerformanceBucket", + "type": "string" + }, + { + "name": "Properties", + "type": "dynamic" + }, + { + "name": "Measurements", + "type": "dynamic" + }, + { + "name": "OperationName", + "type": "string" + }, + { + "name": "OperationId", + "type": "string" + }, + { + "name": "OperationLinks", + "type": "dynamic" + }, + { + "name": "ParentId", + "type": "string" + }, + { + "name": "SyntheticSource", + "type": "string" + }, + { + "name": "SessionId", + "type": "string" + }, + { + "name": "UserId", + "type": "string" + }, + { + "name": "UserAuthenticatedId", + "type": "string" + }, + { + "name": "UserAccountId", + "type": "string" + }, + { + "name": "AppVersion", + "type": "string" + }, + { + "name": "AppRoleName", + "type": "string" + }, + { + "name": "AppRoleInstance", + "type": "string" + }, + { + "name": "ClientType", + "type": "string" + }, + { + "name": "ClientModel", + "type": "string" + }, + { + "name": "ClientOS", + "type": "string" + }, + { + "name": "ClientIP", + "type": "string" + }, + { + "name": "ClientCity", + "type": "string" + }, + { + "name": "ClientStateOrProvince", + "type": "string" + }, + { + "name": "ClientCountryOrRegion", + "type": "string" + }, + { + "name": "ClientBrowser", + "type": "string" + }, + { + "name": "ResourceGUID", + "type": "string" + }, + { + "name": "IKey", + "type": "string" + }, + { + "name": "SDKVersion", + "type": "string" + }, + { + "name": "ItemCount", + "type": "int" + }, + { + "name": "ReferencedItemId", + "type": "string" + }, + { + "name": "ReferencedType", + "type": "string" + }, + { + "name": "SourceSystem", + "type": "string" + }, + { + "name": "Type", + "type": "string" + }, + { + "name": "_ResourceId", + "type": "string" + } + ], + "rows": [ + [ + "d2d0e126-fa1e-4b0a-b647-250cdd471e68", + "2021-06-02T16:31:25.383Z", + "08bf242cdc68504c", + "", + "ServiceBus.process", + "", + true, + "200", + 0, + "<250ms", + "{\"x-opt-enqueued-time\":\"1622651483\"}", + null, + "ServiceBus.process", + "65d9eb1ccf85b1b7ed1e2ea6bb72f563", + null, + "146140ce8493a6ed", + "", + "", + "", + "", + "", + "", + "", + "srikanta", + "PC", + "", + "", + "0.0.0.0", + "Edmonds", + "Washington", + "United States", + "", + "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be", + "b4f83947-968d-4e2f-82ad-804be07697ae", + "java:3.1.1-BETA.2", + 1, + "", + "", + "Azure", + "AppRequests", + "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights" + ], + [ + "d2d0e126-fa1e-4b0a-b647-250cdd471e68", + "2021-06-02T16:32:25.492Z", + "9f4cd78c10d57b4f", + "", + "ServiceBus.process", + "", + true, + "200", + 0, + "<250ms", + "{\"x-opt-enqueued-time\":\"1622651483\"}", + null, + "ServiceBus.process", + "ae054fe7b7ac3adf8b841ebbe1ecb912", + null, + "14eab103a1969665", + "", + "", + "", + "", + "", + "", + "", + "srikanta", + "PC", + "", + "", + "0.0.0.0", + "Edmonds", + "Washington", + "United States", + "", + "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be", + "b4f83947-968d-4e2f-82ad-804be07697ae", + "java:3.1.1-BETA.2", + 1, + "", + "", + "Azure", + "AppRequests", + "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights" + ], + [ + "d2d0e126-fa1e-4b0a-b647-250cdd471e68", + "2021-06-02T16:33:25.585Z", + "ea7e09d4baa4e4ce", + "", + "ServiceBus.process", + "", + true, + "200", + 0, + "<250ms", + "{\"x-opt-enqueued-time\":\"1622651483\"}", + null, + "ServiceBus.process", + "ba6162e3ccd803086944750b82600a3a", + null, + "b60455183860caaf", + "", + "", + "", + "", + "", + "", + "", + "srikanta", + "PC", + "", + "", + "0.0.0.0", + "Edmonds", + "Washington", + "United States", + "", + "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be", + "b4f83947-968d-4e2f-82ad-804be07697ae", + "java:3.1.1-BETA.2", + 1, + "", + "", + "Azure", + "AppRequests", + "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights" + ] + ] + } + ] + } + } + ] + } + } + } +} From a40aabf76646f487ba90350e3e489358d8ab135d Mon Sep 17 00:00:00 2001 From: Srikanta Date: Wed, 2 Jun 2021 13:59:43 -0700 Subject: [PATCH 17/24] Update query body --- .../OperationalInsights.json | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json index 7e78313d4302..d98b7d05120b 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -288,27 +288,6 @@ "type": "string" } }, - "workspaceIdsParam": { - "description": "Workspace IDs to include in cross-workspace queries.", - "type": "array", - "items": { - "type": "string" - } - }, - "qualifiedNamesParam": { - "description": "Qualified Name - string with format //.", - "type": "array", - "items": { - "type": "string" - } - }, - "azureResourceIdsParam": { - "description": "Azure Resource ID - string with format /subscriptions//resourceGroups//providers/microsoft.operationalinsights/workspaces/.", - "type": "array", - "items": { - "type": "string" - } - }, "queryBody": { "description": "The Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", "type": "object", @@ -324,18 +303,6 @@ "workspaces": { "description": "A list of workspaces that are included in the query.", "$ref": "#/definitions/workspacesParam" - }, - "qualifiedNames": { - "description": "A list of qualified workspace names that are included in the query.", - "$ref": "#/definitions/qualifiedNamesParam" - }, - "workspaceIds": { - "description": "A list of workspace IDs that are included in the query.", - "$ref": "#/definitions/workspaceIdsParam" - }, - "azureResourceIds": { - "description": "A list of Azure resource IDs that are included in the query.", - "$ref": "#/definitions/azureResourceIdsParam" } }, "required": [ From a3fdad65a35350a3f0aca48c7867eb3c0748bafa Mon Sep 17 00:00:00 2001 From: Srikanta Date: Thu, 3 Jun 2021 15:00:33 -0700 Subject: [PATCH 18/24] Address PR comments --- .../OperationalInsights.json | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json index d98b7d05120b..1df44e69a69a 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -375,11 +375,11 @@ }, "type": { "description": "The data type of this column.", - "$ref": "#/definitions/ColumnDataType" + "$ref": "#/definitions/logsColumnDataType" } } }, - "ColumnDataType": { + "logsColumnDataType": { "type": "string", "description": "The data type of this column.", "enum": [ @@ -389,10 +389,13 @@ "int", "long", "real", - "string" + "string", + "guid", + "decimal", + "timespan" ], "x-ms-enum": { - "name": "ColumnDataType", + "name": "LogsColumnDataType", "modelAsString": true } }, @@ -1304,12 +1307,12 @@ "type": "array", "description": "An single request in a batch.", "items": { - "$ref": "#/definitions/logQueryRequest" + "$ref": "#/definitions/batchQueryRequest" } } } }, - "logQueryRequest": { + "batchQueryRequest": { "type": "object", "description": "An single request in a batch.", "properties": { @@ -1352,12 +1355,12 @@ "type": "array", "description": "An array of responses corresponding to each individual request in a batch.", "items": { - "$ref": "#/definitions/logQueryResponse" + "$ref": "#/definitions/batchQueryResponse" } } } }, - "logQueryResponse": { + "batchQueryResponse": { "type": "object", "properties": { "id": { @@ -1368,7 +1371,7 @@ }, "body": { "type": "object", - "$ref": "#/definitions/logQueryResult" + "$ref": "#/definitions/batchQueryResult" }, "headers": { "type": "object", @@ -1378,7 +1381,7 @@ } } }, - "logQueryResult": { + "batchQueryResult": { "title": "A query response for a single logs query in a batch.", "description": "Contains the tables, columns & rows resulting from the query or the error details if the query failed.", "type": "object", @@ -1390,6 +1393,11 @@ "$ref": "#/definitions/table" } }, + "statistics": { + "type": "object", + "description": "Statistics represented in JSON format.", + "properties": {} + }, "error": { "$ref": "#/definitions/errorInfo" } From 8ad2b5bf5b269369e6fe6660391125eb18fd3d65 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Fri, 4 Jun 2021 10:27:46 -0700 Subject: [PATCH 19/24] Add error info for single query response --- .../OperationalInsights.json | 48 ++++++++----------- .../operationalinsights/data-plane/readme.md | 2 +- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json index 1df44e69a69a..2e8937472cc3 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -268,7 +268,7 @@ "in": "header", "required": false, "type": "string", - "description": "Optional. The prefer header to set server timeout, ", + "description": "Optional. The prefer header to set server timeout, query statistics and visualization information.", "x-ms-parameter-location": "method" } }, @@ -325,6 +325,9 @@ "type": "object", "description": "Statistics represented in JSON format.", "properties": {} + }, + "error": { + "$ref": "#/definitions/errorInfo" } }, "required": [ @@ -779,7 +782,10 @@ "int", "long", "real", - "string" + "string", + "guid", + "decimal", + "timespan" ], "x-ms-enum": { "name": "MetadataColumnDataType", @@ -1310,7 +1316,10 @@ "$ref": "#/definitions/batchQueryRequest" } } - } + }, + "required": [ + "requests" + ] }, "batchQueryRequest": { "type": "object", @@ -1345,11 +1354,16 @@ "description": "Workspace Id to be included in the query", "type": "string" } - } + }, + "required": [ + "workspace", + "body", + "id" + ] }, "batchResponse": { "type": "object", - "description": "Response to a batch.", + "description": "Response to a batch query.", "properties": { "responses": { "type": "array", @@ -1371,7 +1385,7 @@ }, "body": { "type": "object", - "$ref": "#/definitions/batchQueryResult" + "$ref": "#/definitions/queryResults" }, "headers": { "type": "object", @@ -1380,28 +1394,6 @@ } } } - }, - "batchQueryResult": { - "title": "A query response for a single logs query in a batch.", - "description": "Contains the tables, columns & rows resulting from the query or the error details if the query failed.", - "type": "object", - "properties": { - "tables": { - "description": "The list of tables, columns and rows.", - "type": "array", - "items": { - "$ref": "#/definitions/table" - } - }, - "statistics": { - "type": "object", - "description": "Statistics represented in JSON format.", - "properties": {} - }, - "error": { - "$ref": "#/definitions/errorInfo" - } - } } } } diff --git a/specification/operationalinsights/data-plane/readme.md b/specification/operationalinsights/data-plane/readme.md index cf2da53d33de..f74eef9fcd6a 100644 --- a/specification/operationalinsights/data-plane/readme.md +++ b/specification/operationalinsights/data-plane/readme.md @@ -54,7 +54,7 @@ directive: ``` yaml $(tag) == '20210519' input-file: -- Microsoft.OperationalInsights/preview/2021-05-19/OperationalInsights.json +- Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json directive: - reason: Include batch query and add prefer headers to query request where-operation: Query_Post From 26b7123bbb0c87da7a3e3a5a039668efcd2ce10f Mon Sep 17 00:00:00 2001 From: Srikanta Date: Fri, 4 Jun 2021 10:30:46 -0700 Subject: [PATCH 20/24] Include batch example --- .../2021-05-19_Preview/OperationalInsights.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json index 2e8937472cc3..00a9ccf7bd72 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -188,6 +188,11 @@ "operationId": "Query_Batch", "summary": "Execute a batch of Analytics queries", "description": "Executes a batch of Analytics queries for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query.", + "x-ms-examples": { + "metadataPost": { + "$ref": "examples/batch-query-example.json" + } + }, "parameters": [ { "name": "body", @@ -378,11 +383,11 @@ }, "type": { "description": "The data type of this column.", - "$ref": "#/definitions/logsColumnDataType" + "$ref": "#/definitions/logsColumnType" } } }, - "logsColumnDataType": { + "logsColumnType": { "type": "string", "description": "The data type of this column.", "enum": [ @@ -398,7 +403,7 @@ "timespan" ], "x-ms-enum": { - "name": "LogsColumnDataType", + "name": "logsColumnType", "modelAsString": true } }, From 1a5896a4ffe3e0b6e425ef58e111ef09c0f4d9cd Mon Sep 17 00:00:00 2001 From: Srikanta Date: Mon, 7 Jun 2021 17:39:46 -0700 Subject: [PATCH 21/24] update batch results --- .../OperationalInsights.json | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json index 00a9ccf7bd72..d631ad604e67 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -1390,7 +1390,7 @@ }, "body": { "type": "object", - "$ref": "#/definitions/queryResults" + "$ref": "#/definitions/batchQueryResults" }, "headers": { "type": "object", @@ -1399,6 +1399,28 @@ } } } + }, + "batchQueryResults": { + "title": "A query response for a single query in a batch.", + "description": "Contains the tables, columns & rows resulting from a query.", + "type": "object", + "properties": { + "tables": { + "description": "The list of tables, columns and rows.", + "type": "array", + "items": { + "$ref": "#/definitions/table" + } + }, + "statistics": { + "type": "object", + "description": "Statistics represented in JSON format.", + "properties": {} + }, + "error": { + "$ref": "#/definitions/errorInfo" + } + } } } } From 8ac4dfcbb24e5d3d6c23b880f93068f30b7f6da0 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Mon, 14 Jun 2021 13:15:38 -0700 Subject: [PATCH 22/24] rendering response as object --- .../2021-05-19_Preview/OperationalInsights.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json index d631ad604e67..9e42092a361f 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -331,6 +331,11 @@ "description": "Statistics represented in JSON format.", "properties": {} }, + "render": { + "type": "object", + "description": "Visualization data in JSON format.", + "properties": {} + }, "error": { "$ref": "#/definitions/errorInfo" } @@ -1417,6 +1422,11 @@ "description": "Statistics represented in JSON format.", "properties": {} }, + "render": { + "type": "object", + "description": "Visualization data in JSON format.", + "properties": {} + }, "error": { "$ref": "#/definitions/errorInfo" } From fe2c2cc08c9c95d0ccdbf7fc030266afbac3c9ae Mon Sep 17 00:00:00 2001 From: Srikanta Date: Tue, 15 Jun 2021 13:29:16 -0700 Subject: [PATCH 23/24] Update row value type to object --- .../preview/2021-05-19_Preview/OperationalInsights.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json index 9e42092a361f..9fb5a9d7d8f8 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -366,7 +366,7 @@ "items": { "type": "array", "items": { - "type": "string" + "type": "object" } } } From 8500c9eeeca8d257745942127795031a8ce81989 Mon Sep 17 00:00:00 2001 From: Srikanta Date: Wed, 16 Jun 2021 11:18:27 -0700 Subject: [PATCH 24/24] update security definition to oauth2 --- .../preview/2021-05-19_Preview/OperationalInsights.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json index 9fb5a9d7d8f8..ce0df645a5bb 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -27,7 +27,7 @@ "application/json" ], "securityDefinitions": { - "azure_auth": { + "oauth2": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit",