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 new file mode 100644 index 000000000000..ce0df645a5bb --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/OperationalInsights.json @@ -0,0 +1,1436 @@ +{ + "swagger": "2.0", + "info": { + "version": "2021-05-19_Preview", + "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": { + "oauth2": { + "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": [ + { + "oauth2": [ + "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" + }, + { + "$ref": "#/parameters/PreferHeaderParameter" + } + ], + "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.", + "x-ms-examples": { + "metadataPost": { + "$ref": "examples/batch-query-example.json" + } + }, + "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" + }, + "PreferHeaderParameter": { + "name": "Prefer", + "in": "header", + "required": false, + "type": "string", + "description": "Optional. The prefer header to set server timeout, query statistics and visualization information.", + "x-ms-parameter-location": "method" + } + }, + "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 names 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" + } + }, + "statistics": { + "type": "object", + "description": "Statistics represented in JSON format.", + "properties": {} + }, + "render": { + "type": "object", + "description": "Visualization data in JSON format.", + "properties": {} + }, + "error": { + "$ref": "#/definitions/errorInfo" + } + }, + "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": "object" + } + } + } + }, + "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/logsColumnType" + } + } + }, + "logsColumnType": { + "type": "string", + "description": "The data type of this column.", + "enum": [ + "bool", + "datetime", + "dynamic", + "int", + "long", + "real", + "string", + "guid", + "decimal", + "timespan" + ], + "x-ms-enum": { + "name": "logsColumnType", + "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", + "guid", + "decimal", + "timespan" + ], + "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/batchQueryRequest" + } + } + }, + "required": [ + "requests" + ] + }, + "batchQueryRequest": { + "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" + } + }, + "required": [ + "workspace", + "body", + "id" + ] + }, + "batchResponse": { + "type": "object", + "description": "Response to a batch query.", + "properties": { + "responses": { + "type": "array", + "description": "An array of responses corresponding to each individual request in a batch.", + "items": { + "$ref": "#/definitions/batchQueryResponse" + } + } + } + }, + "batchQueryResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "body": { + "type": "object", + "$ref": "#/definitions/batchQueryResults" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "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": {} + }, + "render": { + "type": "object", + "description": "Visualization data in JSON format.", + "properties": {} + }, + "error": { + "$ref": "#/definitions/errorInfo" + } + } + } + } +} 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" + ] + ] + } + ] + } + } + ] + } + } + } +} diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/metadata-get.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/metadata-get.json new file mode 100644 index 000000000000..a2c34fe519aa --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/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_Preview/examples/metadata-post.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/examples/metadata-post.json new file mode 100644 index 000000000000..ebfe9e55d2af --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/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_Preview/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 new file mode 100644 index 000000000000..d1e3647f86ef --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/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_Preview/examples/oms-get-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/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_Preview/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_Preview/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 new file mode 100644 index 000000000000..20a06125bd66 --- /dev/null +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/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_Preview/examples/oms-post-example.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2021-05-19_Preview/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_Preview/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" + ] + ] + } + ] + } + } + } +} diff --git a/specification/operationalinsights/data-plane/readme.md b/specification/operationalinsights/data-plane/readme.md index f1e857ed5d8f..f74eef9fcd6a 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_Preview/OperationalInsights.json +directive: + - reason: Include batch query and add prefer headers to query request + where-operation: Query_Post + transform: $.operationId = "Query" +``` + --- # Code Generation