{ "swagger": "2.0", "info": { "title": "Monitor Query Logs", "version": "v1", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "{endpoint}/{apiVersion}", "useSchemePrefix": false, "parameters": [ { "name": "endpoint", "in": "path", "description": "The Log Analytics service endpoint.", "required": true, "type": "string", "format": "uri", "default": "https://api.loganalytics.io", "x-ms-skip-url-encoding": true }, { "name": "apiVersion", "in": "path", "description": "The service API version.", "required": true, "type": "string", "enum": [ "v1" ], "x-ms-enum": { "name": "Versions", "modelAsString": true, "values": [ { "name": "V1", "value": "v1", "description": "The V1 API version." } ] } } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "OAuth2Auth": [ "https://api.loganalytics.io/.default" ] } ], "securityDefinitions": { "OAuth2Auth": { "type": "oauth2", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "https://api.loganalytics.io/.default": "" } } }, "tags": [], "paths": { "/{resourceId}/query": { "get": { "operationId": "Query_GetWithResourceId", "summary": "Execute an Analytics query using resource URI", "description": "Executes an Analytics query for data in the context of a resource.\n[Here](https://learn.microsoft.com/azure/azure-monitor/logs/api/azure-resource-queries)\nis an example for using POST with an Analytics query.", "parameters": [ { "name": "resourceId", "in": "path", "description": "The identifier of the resource.", "required": true, "type": "string", "x-ms-skip-url-encoding": true }, { "name": "query", "in": "query", "description": "The Analytics query. Learn more about the\n[Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", "required": true, "type": "string" }, { "name": "timespan", "in": "query", "description": "Optional. The timespan over which to query data. This is an ISO8601 time period\nvalue. This timespan is applied in addition to any that are specified in the\nquery expression.", "required": false, "type": "string", "format": "duration" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/QueryResults" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Simple resource-centric GET query": { "$ref": "./examples/la-get-resource-centric-example.json" } } }, "post": { "operationId": "Query_ExecuteWithResourceId", "summary": "Execute an Analytics query using resource ID", "description": "Executes an Analytics query for data in the context of a resource.\n[Here](https://learn.microsoft.com/azure/azure-monitor/logs/api/azure-resource-queries)\nis an example for using POST with an Analytics query.", "parameters": [ { "name": "resourceId", "in": "path", "description": "The identifier of the resource.", "required": true, "type": "string", "x-ms-skip-url-encoding": true }, { "name": "Prefer", "in": "header", "description": "Optional. The prefer header to set server timeout, query statistics and\nvisualization information.", "required": false, "type": "string", "x-ms-client-name": "prefer" }, { "name": "body", "in": "body", "description": "The Analytics query. Learn more about the\n[Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", "required": true, "schema": { "$ref": "#/definitions/QueryBody" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/QueryResults" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Simple resource-centric POST query": { "$ref": "./examples/la-post-resource-centric-example.json" } } } }, "/$batch": { "post": { "operationId": "Query_Batch", "summary": "Execute a batch of Analytics queries", "description": "Executes a batch of Analytics queries for data.\n[Here](https://learn.microsoft.com/azure/azure-monitor/logs/api/batch-queries)\nis an example for using POST with an Analytics query.", "parameters": [ { "name": "body", "in": "body", "description": "The batch request body", "required": true, "schema": { "$ref": "#/definitions/BatchRequest" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/BatchResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "A batch query": { "$ref": "./examples/batch-query-example.json" } } } }, "/workspaces/{workspaceId}/metadata": { "get": { "operationId": "Metadata_Get", "summary": "Gets metadata information", "description": "Retrieve the metadata information for the workspace, including its schema,\nfunctions, workspace info, categories etc.", "parameters": [ { "name": "workspaceId", "in": "path", "description": "Primary Workspace ID of the query. This is the Workspace ID from the Properties\nblade in the Azure portal.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/MetadataResults" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Metadata GET request": { "$ref": "./examples/metadata-get.json" } } }, "post": { "operationId": "Metadata_Post", "summary": "Gets metadata information", "description": "Retrieve the metadata information for the workspace, including its schema,\nfunctions, workspace info, categories etc.", "parameters": [ { "name": "workspaceId", "in": "path", "description": "Primary Workspace ID of the query. This is the Workspace ID from the Properties\nblade in the Azure portal.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/MetadataResults" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Metadata POST request": { "$ref": "./examples/metadata-post.json" } } } }, "/workspaces/{workspaceId}/query": { "get": { "operationId": "Query_Get", "summary": "Execute an Analytics query", "description": "Executes an Analytics query for data.", "parameters": [ { "name": "workspaceId", "in": "path", "description": "Primary Workspace ID of the query. This is the Workspace ID from the Properties\nblade in the Azure portal.", "required": true, "type": "string" }, { "name": "query", "in": "query", "description": "The Analytics query. Learn more about the\n[Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", "required": true, "type": "string" }, { "name": "timespan", "in": "query", "description": "Optional. The timespan over which to query data. This is an ISO8601 time period\nvalue. This timespan is applied in addition to any that are specified in the\nquery expression.", "required": false, "type": "string", "format": "duration" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/QueryResults" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "A cross workspace GET query": { "$ref": "./examples/la-get-cross-workspace-example.json" }, "A simple GET query on a workspace": { "$ref": "./examples/la-get-example.json" } } }, "post": { "operationId": "Query_Execute", "summary": "Execute an Analytics query", "description": "Executes an Analytics query for data.\n[Here](https://learn.microsoft.com/azure/azure-monitor/logs/api/request-format)\nis an example for using POST with an Analytics query.", "parameters": [ { "name": "workspaceId", "in": "path", "description": "Primary Workspace ID of the query. This is the Workspace ID from the Properties\nblade in the Azure portal.", "required": true, "type": "string" }, { "name": "Prefer", "in": "header", "description": "Optional. The prefer header to set server timeout, query statistics and visualization information.", "required": false, "type": "string", "x-ms-client-name": "prefer" }, { "name": "body", "in": "body", "description": "The Analytics query. Learn more about the\n[Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", "required": true, "schema": { "$ref": "#/definitions/QueryBody" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/QueryResults" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "A cross workspace POST query": { "$ref": "./examples/la-post-cross-workspace-example.json" }, "A simple POST query on a workspace": { "$ref": "./examples/la-post-example.json" } } } } }, "definitions": { "BatchQueryRequest": { "type": "object", "description": "A single request in a batch.", "properties": { "id": { "type": "string", "description": "Unique ID corresponding to each request in the batch." }, "headers": { "type": "object", "description": "Headers of the request. Can use prefer header to set server timeout and to\nquery statistics and visualization information.", "additionalProperties": { "type": "string" } }, "body": { "$ref": "#/definitions/QueryBody", "description": "The Analytics query. Learn more about the\n[Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)" }, "path": { "type": "string", "description": "The query path of a single request in a batch." }, "method": { "type": "string", "description": "The method of a single request in a batch, defaults to GET", "default": "GET" }, "workspace": { "type": "string", "description": "Primary Workspace ID of the query. This is the Workspace ID from the Properties\nblade in the Azure portal." } }, "required": [ "id", "body", "path", "method", "workspace" ] }, "BatchQueryResponse": { "type": "object", "description": "Contains the batch query response and the headers, id, and status of the request", "properties": { "id": { "type": "string", "description": "Unique ID corresponding to each request in the batch." }, "status": { "type": "integer", "format": "int32", "description": "The HTTP status code of the response." }, "body": { "$ref": "#/definitions/BatchQueryResults", "description": "Contains the tables, columns & rows resulting from a query." }, "headers": { "type": "object", "description": "Dictionary of ", "additionalProperties": { "type": "string" } } } }, "BatchQueryResults": { "type": "object", "description": "Contains the tables, columns & rows resulting from a query.", "properties": { "tables": { "type": "array", "description": "The results of the query in tabular format.", "items": { "$ref": "#/definitions/Table" } }, "statistics": { "type": "object", "description": "Statistics represented in JSON format.", "additionalProperties": {} }, "render": { "type": "object", "description": "Visualization data in JSON format.", "additionalProperties": {} }, "error": { "$ref": "#/definitions/ErrorInfo", "description": "The code and message for an 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" ] }, "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" } } } }, "Column": { "type": "object", "description": "A column in a table.", "properties": { "name": { "type": "string", "description": "The name of this column." }, "type": { "$ref": "#/definitions/ColumnDataType", "description": "The data type of this column." } }, "required": [ "name", "type" ] }, "ColumnDataType": { "type": "string", "description": "The data type of a column.", "enum": [ "bool", "datetime", "dynamic", "int", "long", "real", "string", "guid", "decimal", "timespan" ], "x-ms-enum": { "name": "ColumnDataType", "modelAsString": true, "values": [ { "name": "bool", "value": "bool", "description": "Boolean data type" }, { "name": "datetime", "value": "datetime", "description": "DateTime data type" }, { "name": "dynamic", "value": "dynamic", "description": "Dynamic data type" }, { "name": "int", "value": "int", "description": "Integer data type" }, { "name": "long", "value": "long", "description": "Long integer data type" }, { "name": "real", "value": "real", "description": "Real/floating point data type" }, { "name": "string", "value": "string", "description": "String data type" }, { "name": "guid", "value": "guid", "description": "GUID data type" }, { "name": "decimal", "value": "decimal", "description": "Decimal data type" }, { "name": "timespan", "value": "timespan", "description": "Timespan data type" } ] } }, "ErrorDetail": { "type": "object", "description": "Error details.", "properties": { "code": { "type": "string", "description": "The error's code." }, "message": { "type": "string", "description": "A human readable error message." }, "target": { "type": "string", "description": "Indicates which property in the request is responsible for the error." }, "value": { "type": "string", "description": "Indicates which value in 'target' is responsible for the error." }, "resources": { "type": "array", "description": "Indicates resources which were responsible for the error.", "items": { "type": "string" } }, "additionalProperties": { "type": "object", "description": "Additional properties that can be provided on the error details object", "additionalProperties": {} } }, "required": [ "code", "message" ] }, "ErrorInfo": { "type": "object", "description": "The code and message for an error.", "properties": { "code": { "type": "string", "description": "A machine readable error code." }, "message": { "type": "string", "description": "A human readable error message." }, "details": { "type": "array", "description": "error details.", "items": { "$ref": "#/definitions/ErrorDetail" } }, "innererror": { "$ref": "#/definitions/ErrorInfo", "description": "Inner error details if they exist." }, "additionalProperties": { "type": "object", "description": "Additional properties that can be provided on the error info object", "additionalProperties": {} } }, "required": [ "code", "message" ] }, "ErrorResponse": { "type": "object", "description": "Contains details when the response code indicates an error.", "properties": { "error": { "$ref": "#/definitions/ErrorInfo", "description": "The error details." } }, "required": [ "error" ] }, "MetadataApplication": { "type": "object", "description": "Application Insights apps that were part of the metadata request and that the\nuser has access to.", "properties": { "id": { "type": "string", "description": "The ID of the Application Insights app." }, "resourceId": { "type": "string", "description": "The ARM resource ID of the Application Insights app." }, "name": { "type": "string", "description": "The name of the Application Insights app." }, "region": { "type": "string", "description": "The Azure region of the Application Insights app." }, "related": { "$ref": "#/definitions/MetadataApplicationRelated", "description": "The related metadata items for the Application Insights app." } }, "required": [ "id", "resourceId", "name", "region" ] }, "MetadataApplicationRelated": { "type": "object", "description": "The related metadata items for the Application Insights app.", "properties": { "tables": { "type": "array", "description": "The related tables for the Application Insights app.", "items": { "type": "string" } }, "functions": { "type": "array", "description": "The related functions for the Application Insights app.", "items": { "type": "string" } } } }, "MetadataCategory": { "type": "object", "description": "Categories are used to group other metadata entities.", "properties": { "id": { "type": "string", "description": "The ID of the category" }, "displayName": { "type": "string", "description": "The display name of the category" }, "description": { "type": "string", "description": "The description of the category" }, "related": { "$ref": "#/definitions/MetadataCategoryRelated", "description": "The related metadata items for the category" } }, "required": [ "id", "displayName" ] }, "MetadataCategoryRelated": { "type": "object", "description": "The related metadata items for the category", "properties": { "tables": { "type": "array", "description": "The tables related to the category", "items": { "type": "string" } }, "functions": { "type": "array", "description": "The functions related to the category", "items": { "type": "string" } }, "resourceTypes": { "type": "array", "description": "The resource types related to the category", "items": { "type": "string" } }, "queries": { "type": "array", "description": "The saved queries related to the category", "items": { "type": "string" } }, "solutions": { "type": "array", "description": "The Log Analytics solutions related to the category", "items": { "type": "string" } } } }, "MetadataFunction": { "type": "object", "description": "Functions are stored Kusto queries that can be specified as part of queries by\nusing their name.", "properties": { "id": { "type": "string", "description": "The ID of the function." }, "name": { "type": "string", "description": "The name of the function, to be used in queries." }, "parameters": { "type": "string", "description": "The parameters/arguments of the function, if any." }, "displayName": { "type": "string", "description": "The display name of the function." }, "description": { "type": "string", "description": "The description of the function." }, "body": { "type": "string", "description": "The KQL body of the function." }, "tags": { "type": "object", "description": "The tags associated with the function.", "additionalProperties": { "type": "string" } }, "properties": { "type": "object", "description": "The properties of the function.", "additionalProperties": {} }, "related": { "$ref": "#/definitions/MetadataFunctionRelated", "description": "The related metadata items for the function." } }, "required": [ "id", "name", "body" ] }, "MetadataFunctionRelated": { "type": "object", "description": "The related metadata items for the function.", "properties": { "tables": { "type": "array", "description": "The related tables for the function.", "items": { "type": "string" } }, "solutions": { "type": "array", "description": "The related Log Analytics solutions for the function.", "items": { "type": "string" } }, "resourceTypes": { "type": "array", "description": "The related resource types for the function.", "items": { "type": "string" } }, "categories": { "type": "array", "description": "The related categories for the function.", "items": { "type": "string" } }, "workspaces": { "type": "array", "description": "The related workspaces for the function.", "items": { "type": "string" } } } }, "MetadataPermissions": { "type": "object", "description": "Permission information for the metadata call, includes apps/workspaces/resource\nthe user didn't have access to.", "properties": { "workspaces": { "type": "array", "description": "The permission indication for the workspaces on the metadata request.", "items": { "$ref": "#/definitions/MetadataPermissionsWorkspacesItem" } }, "resources": { "type": "array", "description": "The permission indication for the Azure resources on the metadata request.", "items": { "$ref": "#/definitions/MetadataPermissionsResourcesItem" } }, "applications": { "type": "array", "description": "The permission indication for the Application Insights apps on the metadata\nrequest.", "items": { "$ref": "#/definitions/MetadataPermissionsApplicationsItem" } } }, "required": [ "workspaces" ] }, "MetadataPermissionsApplicationsItem": { "type": "object", "description": "The permission indication for the Application Insights apps on the metadata request.", "properties": { "resourceId": { "type": "string", "description": "The resource ID on the permission indication." } }, "required": [ "resourceId" ] }, "MetadataPermissionsResourcesItem": { "type": "object", "description": "The permission indication for the Azure resources on the metadata request.", "properties": { "resourceId": { "type": "string", "description": "The resource ID on the permission indication." }, "denyTables": { "type": "array", "description": "The list of tables that were denied access for the resource ID.", "items": { "type": "string" } } }, "required": [ "resourceId" ] }, "MetadataPermissionsWorkspacesItem": { "type": "object", "description": "The permission indication for the workspaces on the metadata request.", "properties": { "resourceId": { "type": "string", "description": "The resource ID on the permission indication." }, "denyTables": { "type": "array", "description": "The list of tables that were denied access for the resource ID.", "items": { "type": "string" } } }, "required": [ "resourceId" ] }, "MetadataQuery": { "type": "object", "description": "Queries are stored pieces of KQL, along with a list of relevant metadata items.", "properties": { "id": { "type": "string", "description": "The ID of the query." }, "displayName": { "type": "string", "description": "The display name of the query." }, "description": { "type": "string", "description": "The description of the query." }, "body": { "type": "string", "description": "The KQL body of the query." }, "labels": { "type": "array", "description": "The user defined labels associated with the query.", "items": { "type": "string" } }, "tags": { "type": "object", "description": "The tags associated with the query.", "additionalProperties": { "type": "string" } }, "properties": { "type": "object", "description": "The properties of the query.", "additionalProperties": {} }, "related": { "$ref": "#/definitions/MetadataQueryRelated", "description": "The related metadata items for the query." } }, "required": [ "id", "body" ] }, "MetadataQueryRelated": { "type": "object", "description": "The related metadata items for the query.", "properties": { "categories": { "type": "array", "description": "The related categories for the query.", "items": { "type": "string" } }, "solutions": { "type": "array", "description": "The related Log Analytics solutions for the query.", "items": { "type": "string" } }, "resourceTypes": { "type": "array", "description": "The related resource types for the query.", "items": { "type": "string" } }, "tables": { "type": "array", "description": "The related tables for the query.", "items": { "type": "string" } } } }, "MetadataResourceType": { "type": "object", "description": "Metadata about types of Azure resources, containing relevant tables, functions,\netc.", "properties": { "id": { "type": "string", "description": "The ID of the resource-type" }, "type": { "type": "string", "description": "The type of the resource-type" }, "displayName": { "type": "string", "description": "The display name of the resource-type" }, "description": { "type": "string", "description": "The description of the resource-type" }, "labels": { "type": "array", "description": "The user-defined labels of the resource-type", "items": { "type": "string" } }, "tags": { "type": "object", "description": "The tags associated with the resource-type", "additionalProperties": { "type": "string" } }, "properties": { "type": "object", "description": "The properties of the resource-type", "additionalProperties": {} }, "related": { "$ref": "#/definitions/MetadataResourceTypeRelated", "description": "The related metadata items for the resource-type" } }, "required": [ "id", "type" ] }, "MetadataResourceTypeRelated": { "type": "object", "description": "The related metadata items for the resource-type", "properties": { "tables": { "type": "array", "description": "The tables related to the resource-type", "items": { "type": "string" } }, "functions": { "type": "array", "description": "The functions related to the resource-type", "items": { "type": "string" } }, "categories": { "type": "array", "description": "The categories related to the resource-type", "items": { "type": "string" } }, "queries": { "type": "array", "description": "The queries related to the resource-type", "items": { "type": "string" } }, "workspaces": { "type": "array", "description": "The Log Analytics workspaces related to the resource-type", "items": { "type": "string" } }, "resources": { "type": "array", "description": "The Azure resources related to the resource-type", "items": { "type": "string" } } } }, "MetadataResults": { "type": "object", "description": "The metadata response for the app, including available tables, etc.", "properties": { "categories": { "type": "array", "description": "The list of categories that are referenced in this metadata response.", "items": { "$ref": "#/definitions/MetadataCategory" } }, "resourceTypes": { "type": "array", "description": "The list of resource types that are referenced in this metadata response.", "items": { "$ref": "#/definitions/MetadataResourceType" } }, "solutions": { "type": "array", "description": "The list of Log Analytics solutions installed on the workspace.", "items": { "$ref": "#/definitions/MetadataSolution" } }, "tables": { "type": "array", "description": "The list of tables and columns that comprise the schema of the workspace.", "items": { "$ref": "#/definitions/MetadataTable" } }, "functions": { "type": "array", "description": "The list of functions stored on the workspace, or introduced by solutions etc.", "items": { "$ref": "#/definitions/MetadataFunction" } }, "queries": { "type": "array", "description": "The list of saved queries stored on the workspace, or introduced by solutions,\nresource types, etc.", "items": { "$ref": "#/definitions/MetadataQuery" } }, "applications": { "type": "array", "description": "The list of Application Insights apps that were referenced in the metadata\nrequest.", "items": { "$ref": "#/definitions/MetadataApplication" } }, "workspaces": { "type": "array", "description": "The list of Log Analytics workspaces that were referenced in the metadata\nrequest.", "items": { "$ref": "#/definitions/MetadataWorkspace" } }, "resources": { "type": "array", "description": "The list of Azure resources that were referenced in the metadata request.", "items": { "type": "string" } }, "permissions": { "type": "array", "description": "The list of permission rules that affected the metadata request.", "items": { "$ref": "#/definitions/MetadataPermissions" } } } }, "MetadataSolution": { "type": "object", "description": "Solutions can group tables and functions that are associated with a certain\nAzure Log Analytics offering.", "properties": { "id": { "type": "string", "description": "The ID of the Log Analytics solution" }, "name": { "type": "string", "description": "The name of the Log Analytics solution" }, "displayName": { "type": "string", "description": "The display name of the Log Analytics solution" }, "description": { "type": "string", "description": "The description of the Log Analytics solution" }, "tags": { "type": "object", "description": "The tags that are associated with the Log Analytics solution", "additionalProperties": { "type": "string" } }, "properties": { "type": "object", "description": "The properties of the Log Analytics solution", "additionalProperties": {} }, "related": { "$ref": "#/definitions/MetadataSolutionRelated", "description": "The related metadata items for the Log Analytics solution" } }, "required": [ "id", "name", "related" ] }, "MetadataSolutionRelated": { "type": "object", "description": "The related metadata items for the Log Analytics solution", "properties": { "tables": { "type": "array", "description": "The tables related to the Log Analytics solution", "items": { "type": "string" } }, "functions": { "type": "array", "description": "The functions related to the Log Analytics solution", "items": { "type": "string" } }, "categories": { "type": "array", "description": "The categories related to the Log Analytics solution", "items": { "type": "string" } }, "queries": { "type": "array", "description": "The saved queries related to the Log Analytics solution", "items": { "type": "string" } }, "workspaces": { "type": "array", "description": "The Workspaces referenced in the metadata request that are related to the Log\nAnalytics solution", "items": { "type": "string" } } }, "required": [ "tables" ] }, "MetadataTable": { "type": "object", "description": "Tables are part of the workspace schema, and contain a list of columns and a\nreference to other relevant metadata items.", "properties": { "id": { "type": "string", "description": "The ID of the table" }, "name": { "type": "string", "description": "The name of the table" }, "description": { "type": "string", "description": "The description of the table" }, "timespanColumn": { "type": "string", "description": "The column associated with the timespan query parameter for the table" }, "labels": { "type": "array", "description": "The user defined labels of the table", "items": { "type": "string" } }, "tags": { "type": "object", "description": "The tags associated with the table", "additionalProperties": { "type": "string" } }, "properties": { "type": "object", "description": "The properties of the table", "additionalProperties": {} }, "columns": { "type": "array", "description": "The list of columns defined on the table", "items": { "$ref": "#/definitions/MetadataTableColumnsItem" } }, "related": { "$ref": "#/definitions/MetadataTableRelated", "description": "The related metadata items for the table" } }, "required": [ "id", "name" ] }, "MetadataTableColumnsItem": { "type": "object", "description": "A column in a metadata table.", "properties": { "name": { "type": "string", "description": "The name of the column" }, "description": { "type": "string", "description": "The description of the column" }, "type": { "$ref": "#/definitions/ColumnDataType", "description": "The data type of the column" }, "isPreferredFacet": { "type": "boolean", "description": "A flag indicating this column is a preferred facet" }, "source": { "type": "object", "description": "An indication of the source of the column, used only when multiple workspaces\nhave conflicting definition for the column", "additionalProperties": {} } }, "required": [ "name", "type" ] }, "MetadataTableRelated": { "type": "object", "description": "The related metadata items for the table", "properties": { "categories": { "type": "array", "description": "The related categories for the table", "items": { "type": "string" } }, "solutions": { "type": "array", "description": "The related Log Analytics solutions for the table", "items": { "type": "string" } }, "resourceTypes": { "type": "array", "description": "The related resource types for the table", "items": { "type": "string" } }, "workspaces": { "type": "array", "description": "The related Log Analytics workspaces for the table", "items": { "type": "string" } }, "functions": { "type": "array", "description": "The related functions for the table", "items": { "type": "string" } }, "queries": { "type": "array", "description": "The related saved queries for the table", "items": { "type": "string" } } } }, "MetadataWorkspace": { "type": "object", "description": "Log Analytics workspaces that were part of the metadata request and that the\nuser has access to.", "properties": { "id": { "type": "string", "description": "The ID of the Log Analytics workspace." }, "resourceId": { "type": "string", "description": "The ARM resource ID of the Log Analytics workspace." }, "name": { "type": "string", "description": "The name of the Log Analytics workspace." }, "region": { "type": "string", "description": "The Azure region of the Log Analytics workspace." }, "related": { "$ref": "#/definitions/MetadataWorkspaceRelated", "description": "The related metadata items for the Log Analytics workspace." } }, "required": [ "id", "resourceId", "name", "region" ] }, "MetadataWorkspaceRelated": { "type": "object", "description": "The related metadata items for the Log Analytics workspace.", "properties": { "tables": { "type": "array", "description": "The related tables for the Log Analytics workspace.", "items": { "type": "string" } }, "solutions": { "type": "array", "description": "The related Log Analytics solutions for the Log Analytics workspace.", "items": { "type": "string" } }, "resourceTypes": { "type": "array", "description": "The related resource types for the Log Analytics workspace.", "items": { "type": "string" } }, "functions": { "type": "array", "description": "The related functions for the Log Analytics workspace.", "items": { "type": "string" } }, "resources": { "type": "array", "description": "The related Azure resources for the Log Analytics workspace.", "items": { "type": "string" } } } }, "QueryBody": { "type": "object", "description": "The Analytics query. Learn more about the\n[Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)", "properties": { "query": { "type": "string", "description": "The query to execute." }, "timespan": { "type": "string", "description": "Optional. The timespan over which to query data. This is an ISO8601 time period\nvalue. This timespan is applied in addition to any that are specified in the\nquery expression." }, "workspaces": { "type": "array", "description": "A list of workspaces to query in addition to the primary workspace.", "items": { "type": "string" } } }, "required": [ "query" ] }, "QueryResults": { "type": "object", "description": "Contains the tables, columns & rows resulting from a query.", "properties": { "tables": { "type": "array", "description": "The results of the query in tabular format.", "items": { "$ref": "#/definitions/Table" } }, "statistics": { "type": "object", "description": "Statistics represented in JSON format.", "additionalProperties": {} }, "render": { "type": "object", "description": "Visualization data in JSON format.", "additionalProperties": {} }, "error": { "$ref": "#/definitions/ErrorInfo", "description": "The code and message for an error." } }, "required": [ "tables" ] }, "Table": { "type": "object", "description": "Contains the columns and rows for one table in a query response.", "properties": { "name": { "type": "string", "description": "The name of the table." }, "columns": { "type": "array", "description": "The list of columns in this table.", "items": { "$ref": "#/definitions/Column" } }, "rows": { "type": "array", "description": "The resulting rows from this query.", "items": { "type": "array", "items": {} } } }, "required": [ "name", "columns", "rows" ] } }, "parameters": {} }